1+ from pathlib import Path
2+
13import numpy as np
24import scipy .sparse
3- from pathlib import Path
5+
46from diffpy .utils .parsers .loaddata import loadData
57
68
@@ -10,8 +12,8 @@ def initialize_variables(data_input, number_of_components, data_type, sparsity=1
1012 Parameters
1113 ----------
1214 data_input: 2d array like
13- The observed or simulated PDF or XRD data provided by the user. Has dimensions R x N where R is the signal length
14- and N is the number of PDF/XRD signals.
15+ The observed or simulated PDF or XRD data provided by the user. Has dimensions R x N where R is the signa
16+ length and N is the number of PDF/XRD signals.
1517
1618 number_of_components: int
1719 The number of component signals the user would like to decompose 'data_input' into.
@@ -20,23 +22,23 @@ def initialize_variables(data_input, number_of_components, data_type, sparsity=1
2022 The type of data the user has passed into the program. Can assume the value of 'PDF' or 'XRD.'
2123
2224 sparsity: float, optional
23- The regularization parameter that behaves as the coefficient of a "sparseness" regularization term that enhances
24- the ability to decompose signals in the case of sparse data e.g. X-ray Diffraction data. A non-zero value
25- indicates sparsity in the data; greater magnitudes indicate greater amounts of sparsity.
25+ The regularization parameter that behaves as the coefficient of a "sparseness" regularization term that
26+ enhances the ability to decompose signals in the case of sparse data e.g. X-ray Diffraction data.
27+ A non-zero value indicates sparsity in the data; greater magnitudes indicate greater amounts of sparsity.
2628
2729 smoothness: float, optional
28- The regularization parameter that behaves as the coefficient of a "smoothness" term that ensures that component
29- signal weightings change smoothly with time. Assumes a default value of 1e18.
30+ The regularization parameter that behaves as the coefficient of a "smoothness" term that ensures that
31+ component signal weightings change smoothly with time. Assumes a default value of 1e18.
3032
3133 Returns
3234 -------
3335 dictionary
34- The collection of the names and values of the constants used in the algorithm. Contains the number of observed PDF
35- /XRD patterns, the length of each pattern, the type of the data, the number of components the user would like to
36- decompose the data into, an initial guess for the component matrix, and initial guess for the weight factor matrix
37- ,an initial guess for the stretching factor matrix, a parameter controlling smoothness of the solution , a
38- parameter controlling sparseness of the solution, the matrix representing the smoothness term, and a matrix used
39- to construct a hessian matrix.
36+ The collection of the names and values of the constants used in the algorithm. Contains the number of
37+ observed PDF /XRD patterns, the length of each pattern, the type of the data, the number of components
38+ the user would like to decompose the data into, an initial guess for the component matrix, and initial
39+ guess for the weight factor matrix, an initial guess for the stretching factor matrix , a parameter
40+ controlling smoothness of the solution, a parameter controlling sparseness of the solution, the matrix
41+ representing the smoothness term, and a matrix used to construct a hessian matrix.
4042
4143 """
4244 signal_length = data_input .shape [0 ]
@@ -74,22 +76,22 @@ def initialize_variables(data_input, number_of_components, data_type, sparsity=1
7476def load_input_signals (file_path = None ):
7577 """Processes a directory of a series of PDF/XRD patterns into a usable format.
7678
77- Constructs a 2d array out of a directory of PDF/XRD patterns containing each files dependent variable column in a
78- new column. Constructs a 1d array containing the grid values.
79+ Constructs a 2d array out of a directory of PDF/XRD patterns containing each files dependent variable
80+ column in a new column. Constructs a 1d array containing the grid values.
7981
8082 Parameters
8183 ----------
8284 file_path: str or Path object, optional
83- The path to the directory containing the input XRD/PDF data. If no path is specified, defaults to the current
84- working directory. Accepts a string or a pathlib.Path object. Input data not on the same grid as the first file
85- read will be ignored.
85+ The path to the directory containing the input XRD/PDF data. If no path is specified, defaults to the
86+ current working directory. Accepts a string or a pathlib.Path object. Input data not on the same grid
87+ as the first file read will be ignored.
8688
8789 Returns
8890 -------
8991 tuple
90- The tuple whose first element is an R x M 2d array made of PDF/XRD patterns as each column; R is the length of the
91- signal and M is the number of patterns. The tuple contains a 1d array containing the values of the grid points as
92- its second element; Has length R.
92+ The tuple whose first element is an R x M 2d array made of PDF/XRD patterns as each column; R is the
93+ length of the signal and M is the number of patterns. The tuple contains a 1d array containing the values
94+ of the grid points as its second element; Has length R.
9395
9496 """
9597
0 commit comments