diffpy.srfit 3.2.0rc0__tar.gz → 3.2.0rc2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/PKG-INFO +1 -1
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/requirements/docs.txt +1 -1
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/fitcontribution.py +3 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/fitrecipe.py +12 -1
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/fitresults.py +9 -3
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/parameter.py +19 -4
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/parameterset.py +1 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/profile.py +13 -2
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/profilegenerator.py +17 -8
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/profileparser.py +16 -19
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/recipeorganizer.py +13 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/restraint.py +5 -1
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/simplerecipe.py +7 -3
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/pdf/basepdfgenerator.py +3 -4
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/pdf/characteristicfunctions.py +13 -7
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/pdf/debyepdfgenerator.py +3 -3
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/pdf/pdfcontribution.py +2 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/pdf/pdfgenerator.py +3 -4
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/pdf/pdfparser.py +18 -17
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/sas/sasgenerator.py +6 -6
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/sas/sasparser.py +22 -20
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/structure/objcrystparset.py +40 -14
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/structure/sgconstraints.py +27 -24
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/util/inpututils.py +1 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/util/tagmanager.py +2 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy.srfit.egg-info/PKG-INFO +1 -1
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/AUTHORS.rst +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/LICENSE.rst +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/LICENSE_DANSE.rst +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/MANIFEST.in +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/README.rst +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/pyproject.toml +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/requirements/build.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/requirements/conda.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/requirements/pip.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/requirements/tests.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/setup.cfg +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/builder.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/equationmod.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/literals/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/literals/abcs.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/literals/argument.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/literals/literal.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/literals/operators.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/visitors/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/visitors/argfinder.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/visitors/printer.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/visitors/swapper.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/visitors/validator.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/equation/visitors/visitor.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/exceptions.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/calculator.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/configurable.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/constraint.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/fithook.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/validatable.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/interface/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/interface/interface.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/pdf/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/sas/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/sas/prcalculator.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/sas/sasimport.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/sas/sasparameter.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/sas/sasprofile.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/structure/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/structure/basestructureparset.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/structure/bvsrestraint.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/structure/cctbxparset.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/structure/diffpyparset.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/structure/srrealparset.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/util/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/util/argbinders.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/util/nameutils.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/util/observable.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/util/weakrefcallable.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/version.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy.srfit.egg-info/SOURCES.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy.srfit.egg-info/dependency_links.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy.srfit.egg-info/requires.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy.srfit.egg-info/top_level.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/__init__.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/conftest.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/debug.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/run.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_builder.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_characteristicfunctions.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_constraint.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_contribution.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_diffpyparset.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_equation.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_fitrecipe.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_fitresults.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_literals.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_objcrystparset.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_parameter.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_parameterset.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_pdf.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_profile.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_profilegenerator.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_recipeorganizer.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_restraint.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_sas.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_sgconstraints.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_speed.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_tagmanager.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_version.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_visitors.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/test_weakrefcallable.py +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/testdata/LaMnO3.stru +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/testdata/ni-q27r100-neutron.gr +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/testdata/ni.cif +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/testdata/results.res +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/testdata/sas_ascii_test_1.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/testdata/sas_ellipsoid_testdata.txt +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/testdata/si-q27r60-xray.gr +0 -0
- {diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/tests/testdata/testdata.txt +0 -0
|
@@ -177,6 +177,7 @@ class FitContribution(ParameterSet):
|
|
|
177
177
|
A name for the calculator. If name is None (default), then
|
|
178
178
|
the ProfileGenerator's name attribute will be used.
|
|
179
179
|
|
|
180
|
+
|
|
180
181
|
Raises ValueError if the ProfileGenerator has no name.
|
|
181
182
|
Raises ValueError if the ProfileGenerator has the same name as some
|
|
182
183
|
other managed object.
|
|
@@ -220,6 +221,7 @@ class FitContribution(ParameterSet):
|
|
|
220
221
|
A dictionary of Parameters, indexed by name, that are used
|
|
221
222
|
in the eqstr, but not registered (default {}).
|
|
222
223
|
|
|
224
|
+
|
|
223
225
|
Raises ValueError if ns uses a name that is already used for a
|
|
224
226
|
variable.
|
|
225
227
|
"""
|
|
@@ -266,6 +268,7 @@ class FitContribution(ParameterSet):
|
|
|
266
268
|
used, or the chi2 residual will be used if that does not
|
|
267
269
|
exist.
|
|
268
270
|
|
|
271
|
+
|
|
269
272
|
Two residuals are preset for convenience, "chiv" and "resv".
|
|
270
273
|
chiv is defined such that dot(chiv, chiv) = chi^2.
|
|
271
274
|
resv is defined such that dot(resv, resv) = Rw^2.
|
|
@@ -187,6 +187,7 @@ class FitRecipe(_fitrecipe_interface, RecipeOrganizer):
|
|
|
187
187
|
index
|
|
188
188
|
Index of FitHook instance to remove (default -1).
|
|
189
189
|
|
|
190
|
+
|
|
190
191
|
Raises ValueError if fithook is not None, but is not present in the
|
|
191
192
|
sequence.
|
|
192
193
|
Raises IndexError if the sequence is empty or index is out of range.
|
|
@@ -214,6 +215,7 @@ class FitRecipe(_fitrecipe_interface, RecipeOrganizer):
|
|
|
214
215
|
con
|
|
215
216
|
The FitContribution to be stored.
|
|
216
217
|
|
|
218
|
+
|
|
217
219
|
Raises ValueError if the FitContribution has no name
|
|
218
220
|
Raises ValueError if the FitContribution has the same name as some
|
|
219
221
|
other managed object.
|
|
@@ -236,6 +238,7 @@ class FitRecipe(_fitrecipe_interface, RecipeOrganizer):
|
|
|
236
238
|
parset
|
|
237
239
|
The ParameterSet to be stored.
|
|
238
240
|
|
|
241
|
+
|
|
239
242
|
Raises ValueError if the ParameterSet has no name.
|
|
240
243
|
Raises ValueError if the ParameterSet has the same name as some other
|
|
241
244
|
managed object.
|
|
@@ -506,7 +509,12 @@ class FitRecipe(_fitrecipe_interface, RecipeOrganizer):
|
|
|
506
509
|
A list of tags (default []). Both tag and tags can be
|
|
507
510
|
applied.
|
|
508
511
|
|
|
509
|
-
|
|
512
|
+
|
|
513
|
+
Returns
|
|
514
|
+
-------
|
|
515
|
+
vars
|
|
516
|
+
ParameterProxy (variable) for the passed Parameter.
|
|
517
|
+
|
|
510
518
|
|
|
511
519
|
Raises ValueError if the name of the variable is already taken by
|
|
512
520
|
another managed object.
|
|
@@ -549,6 +557,7 @@ class FitRecipe(_fitrecipe_interface, RecipeOrganizer):
|
|
|
549
557
|
var
|
|
550
558
|
A variable of the FitRecipe.
|
|
551
559
|
|
|
560
|
+
|
|
552
561
|
Raises ValueError if var is not part of the FitRecipe.
|
|
553
562
|
"""
|
|
554
563
|
|
|
@@ -592,6 +601,7 @@ class FitRecipe(_fitrecipe_interface, RecipeOrganizer):
|
|
|
592
601
|
A list of tags (default []). Both tag and tags can be
|
|
593
602
|
applied.
|
|
594
603
|
|
|
604
|
+
|
|
595
605
|
Returns the new variable (Parameter instance).
|
|
596
606
|
"""
|
|
597
607
|
# This will fix the Parameter
|
|
@@ -798,6 +808,7 @@ class FitRecipe(_fitrecipe_interface, RecipeOrganizer):
|
|
|
798
808
|
A dictionary of Parameters, indexed by name, that are used
|
|
799
809
|
in the eqstr, but not part of this object (default {}).
|
|
800
810
|
|
|
811
|
+
|
|
801
812
|
Raises ValueError if ns uses a name that is already used for a
|
|
802
813
|
variable.
|
|
803
814
|
Raises ValueError if eqstr depends on a Parameter that is not part of
|
|
@@ -90,6 +90,7 @@ class FitResults(object):
|
|
|
90
90
|
The derivatives of the constraint equations with respect to
|
|
91
91
|
the variables. This is used internally.
|
|
92
92
|
|
|
93
|
+
|
|
93
94
|
Each of these attributes, except the recipe, are created or updated when
|
|
94
95
|
the update method is called.
|
|
95
96
|
"""
|
|
@@ -338,7 +339,10 @@ class FitResults(object):
|
|
|
338
339
|
update
|
|
339
340
|
Flag indicating whether to call update() (default False).
|
|
340
341
|
|
|
341
|
-
Returns
|
|
342
|
+
Returns
|
|
343
|
+
-------
|
|
344
|
+
out
|
|
345
|
+
a string containing the formatted results.
|
|
342
346
|
"""
|
|
343
347
|
if update:
|
|
344
348
|
self.update()
|
|
@@ -515,7 +519,7 @@ class FitResults(object):
|
|
|
515
519
|
def printResults(self, header="", footer="", update=False):
|
|
516
520
|
"""Format and print the results.
|
|
517
521
|
|
|
518
|
-
|
|
522
|
+
Parameters
|
|
519
523
|
----------
|
|
520
524
|
header
|
|
521
525
|
A header to add to the output (default "")
|
|
@@ -533,8 +537,10 @@ class FitResults(object):
|
|
|
533
537
|
def saveResults(self, filename, header="", footer="", update=False):
|
|
534
538
|
"""Format and save the results.
|
|
535
539
|
|
|
536
|
-
|
|
540
|
+
Parameters
|
|
537
541
|
----------------------------------
|
|
542
|
+
filename
|
|
543
|
+
Name of the save file.
|
|
538
544
|
header
|
|
539
545
|
A header to add to the output (default "")
|
|
540
546
|
footer
|
|
@@ -72,6 +72,7 @@ class Parameter(_parameter_interface, Argument, Validatable):
|
|
|
72
72
|
A flag inticating whether the Parameter is a constant (like
|
|
73
73
|
pi).
|
|
74
74
|
|
|
75
|
+
|
|
75
76
|
Raises ValueError if the name is not a valid attribute identifier
|
|
76
77
|
"""
|
|
77
78
|
self.constrained = False
|
|
@@ -94,7 +95,10 @@ class Parameter(_parameter_interface, Argument, Validatable):
|
|
|
94
95
|
The upper bounds for the bounds list. If this is None
|
|
95
96
|
(default), then the upper bound will not be alterered.
|
|
96
97
|
|
|
97
|
-
Returns
|
|
98
|
+
Returns
|
|
99
|
+
-------
|
|
100
|
+
self
|
|
101
|
+
Returns self so that mutators can be chained.
|
|
98
102
|
"""
|
|
99
103
|
Argument.setValue(self, val)
|
|
100
104
|
return self
|
|
@@ -112,7 +116,10 @@ class Parameter(_parameter_interface, Argument, Validatable):
|
|
|
112
116
|
is not None, then the parameter will get a new value,
|
|
113
117
|
constant or otherwise.
|
|
114
118
|
|
|
115
|
-
Returns
|
|
119
|
+
Returns
|
|
120
|
+
-------
|
|
121
|
+
self
|
|
122
|
+
Returns self so that mutators can be chained.
|
|
116
123
|
"""
|
|
117
124
|
self.const = bool(const)
|
|
118
125
|
if value is not None:
|
|
@@ -129,7 +136,10 @@ class Parameter(_parameter_interface, Argument, Validatable):
|
|
|
129
136
|
ub
|
|
130
137
|
The upper bound for the bounds list.
|
|
131
138
|
|
|
132
|
-
Returns
|
|
139
|
+
Returns
|
|
140
|
+
-------
|
|
141
|
+
self
|
|
142
|
+
Returns self so that mutators can be chained.
|
|
133
143
|
"""
|
|
134
144
|
if lb is not None:
|
|
135
145
|
self.bounds[0] = lb
|
|
@@ -150,7 +160,10 @@ class Parameter(_parameter_interface, Argument, Validatable):
|
|
|
150
160
|
value + ur. If this is None (default), then the value of the
|
|
151
161
|
lower radius is used.
|
|
152
162
|
|
|
153
|
-
Returns
|
|
163
|
+
Returns
|
|
164
|
+
-------
|
|
165
|
+
self
|
|
166
|
+
Returns self so that mutators can be chained.
|
|
154
167
|
"""
|
|
155
168
|
val = self.getValue()
|
|
156
169
|
lb = val - lr
|
|
@@ -199,6 +212,7 @@ class ParameterProxy(Parameter):
|
|
|
199
212
|
par
|
|
200
213
|
The Parameter this is a proxy for.
|
|
201
214
|
|
|
215
|
+
|
|
202
216
|
Raises ValueError if the name is not a valid attribute identifier
|
|
203
217
|
"""
|
|
204
218
|
validateName(name)
|
|
@@ -312,6 +326,7 @@ class ParameterAdapter(Parameter):
|
|
|
312
326
|
parameter. If attr is None (default), then both getter and
|
|
313
327
|
setter must be specified.
|
|
314
328
|
|
|
329
|
+
|
|
315
330
|
Raises ValueError if exactly one of getter or setter is not None, or if
|
|
316
331
|
getter, setter and attr are all None.
|
|
317
332
|
"""
|
|
@@ -319,7 +319,14 @@ class Profile(Observable, Validatable):
|
|
|
319
319
|
Raises ValueError if the call to numpy.loadtxt returns fewer
|
|
320
320
|
than 2 arrays.
|
|
321
321
|
|
|
322
|
-
Returns
|
|
322
|
+
Returns
|
|
323
|
+
-------
|
|
324
|
+
x
|
|
325
|
+
x array loaded from the file.
|
|
326
|
+
y
|
|
327
|
+
y array loaded from the file.
|
|
328
|
+
dy
|
|
329
|
+
dy array loaded from the file.
|
|
323
330
|
"""
|
|
324
331
|
if len(args) == 8 and not args[-1]:
|
|
325
332
|
args = list(args)
|
|
@@ -423,9 +430,13 @@ def rebinArray(A, xold, xnew):
|
|
|
423
430
|
xnew
|
|
424
431
|
New sampling array
|
|
425
432
|
|
|
433
|
+
|
|
426
434
|
This uses cubic spline interpolation.
|
|
427
435
|
|
|
428
|
-
Returns
|
|
436
|
+
Returns
|
|
437
|
+
-------
|
|
438
|
+
array
|
|
439
|
+
A new array over the new sampling array.
|
|
429
440
|
"""
|
|
430
441
|
if numpy.array_equal(xold, xnew):
|
|
431
442
|
return A
|
{diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/fitbase/profilegenerator.py
RENAMED
|
@@ -20,14 +20,23 @@ be associated with a FitContribution to help calculate a profile.
|
|
|
20
20
|
|
|
21
21
|
To define a ProfileGenerator, one must implement the required Parameters
|
|
22
22
|
and ParameterSets as well as overload the __call__ method with the
|
|
23
|
-
calculation. A very simple example is
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
calculation. A very simple example is
|
|
24
|
+
|
|
25
|
+
.. code:: python
|
|
26
|
+
|
|
27
|
+
class Gaussian(ProfileGenerator):
|
|
28
|
+
def __init__(self):
|
|
29
|
+
# Initialize and give this a name
|
|
30
|
+
ProfileGenerator.__init__(self, "g")
|
|
31
|
+
# Add amplitude, center and width parameters
|
|
32
|
+
self.newParameter("amp", 0)
|
|
33
|
+
self.newParameter("center", 0)
|
|
34
|
+
self.newParameter("width", 0)
|
|
35
|
+
def __call__(self, x):
|
|
36
|
+
a = self.amp.getValue()
|
|
37
|
+
x0 = self.center.getValue()
|
|
38
|
+
w = self.width.getValue()
|
|
39
|
+
return a * exp(-0.5*((x-x0)/w)**2)
|
|
31
40
|
|
|
32
41
|
More examples can be found in the example directory of the
|
|
33
42
|
documentation.
|
|
@@ -29,8 +29,6 @@ from diffpy.srfit.exceptions import ParseError
|
|
|
29
29
|
class ProfileParser(object):
|
|
30
30
|
"""Class for parsing data from a or string.
|
|
31
31
|
|
|
32
|
-
Attributes
|
|
33
|
-
|
|
34
32
|
Attributes
|
|
35
33
|
----------
|
|
36
34
|
_format
|
|
@@ -41,20 +39,20 @@ class ProfileParser(object):
|
|
|
41
39
|
The data from each bank. Each bank contains a (x, y, dx,
|
|
42
40
|
dy)
|
|
43
41
|
tuple:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
x
|
|
43
|
+
A numpy array containing the independent
|
|
44
|
+
variable read from the file.
|
|
45
|
+
y
|
|
46
|
+
A numpy array containing the profile
|
|
47
|
+
from the file.
|
|
48
|
+
dx
|
|
49
|
+
A numpy array containing the uncertainty in x
|
|
50
|
+
read from the file. This is None if the
|
|
51
|
+
uncertainty cannot be read.
|
|
52
|
+
dy
|
|
53
|
+
A numpy array containing the uncertainty read
|
|
54
|
+
from the file. This is None if the uncertainty
|
|
55
|
+
cannot be read.
|
|
58
56
|
_x
|
|
59
57
|
Independent variable from the chosen bank
|
|
60
58
|
_y
|
|
@@ -66,10 +64,9 @@ class ProfileParser(object):
|
|
|
66
64
|
_meta
|
|
67
65
|
A dictionary containing metadata read from the file.
|
|
68
66
|
|
|
69
|
-
General Metadata
|
|
70
67
|
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
General Metadata
|
|
69
|
+
----------------
|
|
73
70
|
filename
|
|
74
71
|
The name of the file from which data was parsed. This key
|
|
75
72
|
will not exist if data was not read from file.
|
|
@@ -250,6 +250,7 @@ class RecipeContainer(Observable, Configurable, Validatable):
|
|
|
250
250
|
If True (default), a ValueError is raised an object of the
|
|
251
251
|
given name already exists.
|
|
252
252
|
|
|
253
|
+
|
|
253
254
|
Raises ValueError if the object has no name.
|
|
254
255
|
Raises ValueError if the object has the same name as some other managed
|
|
255
256
|
object.
|
|
@@ -313,6 +314,7 @@ class RecipeContainer(Observable, Configurable, Validatable):
|
|
|
313
314
|
obj
|
|
314
315
|
The object to find.
|
|
315
316
|
|
|
317
|
+
|
|
316
318
|
Returns a list of objects. The first member of the list is this object,
|
|
317
319
|
and each subsequent member is a sub-object of the previous one. The
|
|
318
320
|
last entry in the list is obj. If obj cannot be found, the list is
|
|
@@ -402,6 +404,7 @@ class RecipeOrganizer(_recipeorganizer_interface, RecipeContainer):
|
|
|
402
404
|
values
|
|
403
405
|
Variable values (read only). See getValues.
|
|
404
406
|
|
|
407
|
+
|
|
405
408
|
Raises ValueError if the name is not a valid attribute identifier
|
|
406
409
|
"""
|
|
407
410
|
|
|
@@ -442,6 +445,7 @@ class RecipeOrganizer(_recipeorganizer_interface, RecipeContainer):
|
|
|
442
445
|
If True (default), a ValueError is raised a Parameter of
|
|
443
446
|
the specified name has already been inserted.
|
|
444
447
|
|
|
448
|
+
|
|
445
449
|
Raises ValueError if the Parameter has no name.
|
|
446
450
|
Raises ValueError if the Parameter has the same name as a contained
|
|
447
451
|
RecipeContainer.
|
|
@@ -527,10 +531,12 @@ class RecipeOrganizer(_recipeorganizer_interface, RecipeContainer):
|
|
|
527
531
|
If this is None (default), then the argument names will
|
|
528
532
|
be extracted from the function.
|
|
529
533
|
|
|
534
|
+
|
|
530
535
|
Note that name and argnames can be extracted from regular python
|
|
531
536
|
functions (of type 'function'), bound class methods and callable
|
|
532
537
|
classes.
|
|
533
538
|
|
|
539
|
+
|
|
534
540
|
Raises TypeError if name or argnames cannot be automatically
|
|
535
541
|
extracted.
|
|
536
542
|
Raises TypeError if an automatically extracted name is '<lambda>'.
|
|
@@ -628,6 +634,7 @@ class RecipeOrganizer(_recipeorganizer_interface, RecipeContainer):
|
|
|
628
634
|
used in fstr, but not part of the FitRecipe (default
|
|
629
635
|
{}).
|
|
630
636
|
|
|
637
|
+
|
|
631
638
|
Raises ValueError if ns uses a name that is already used for another
|
|
632
639
|
managed object.
|
|
633
640
|
Raises ValueError if the function name is the name of another managed
|
|
@@ -660,6 +667,7 @@ class RecipeOrganizer(_recipeorganizer_interface, RecipeContainer):
|
|
|
660
667
|
A dictionary of Parameters, indexed by name, that are
|
|
661
668
|
used in fstr, but not part of the FitRecipe (default {}).
|
|
662
669
|
|
|
670
|
+
|
|
663
671
|
Raises ValueError if ns uses a name that is already used for a
|
|
664
672
|
variable.
|
|
665
673
|
"""
|
|
@@ -689,6 +697,7 @@ class RecipeOrganizer(_recipeorganizer_interface, RecipeContainer):
|
|
|
689
697
|
A dictionary of Parameters, indexed by name, that are used
|
|
690
698
|
in the parameter, but not part of this object (default {}).
|
|
691
699
|
|
|
700
|
+
|
|
692
701
|
Raises ValueError if ns uses a name that is already used for a
|
|
693
702
|
variable.
|
|
694
703
|
Raises ValueError if par is a string but not part of this object or in
|
|
@@ -800,6 +809,7 @@ class RecipeOrganizer(_recipeorganizer_interface, RecipeContainer):
|
|
|
800
809
|
Recurse into managed objects and clear all constraints
|
|
801
810
|
found there as well.
|
|
802
811
|
|
|
812
|
+
|
|
803
813
|
This removes constraints that are held in this organizer, no matter
|
|
804
814
|
where the constrained parameters are from.
|
|
805
815
|
"""
|
|
@@ -833,11 +843,13 @@ class RecipeOrganizer(_recipeorganizer_interface, RecipeContainer):
|
|
|
833
843
|
in the equation string, but not part of the RecipeOrganizer
|
|
834
844
|
(default {}).
|
|
835
845
|
|
|
846
|
+
|
|
836
847
|
The penalty is calculated as
|
|
837
848
|
(max(0, lb - val, val - ub)/sig)**2
|
|
838
849
|
and val is the value of the calculated equation. This is multiplied by
|
|
839
850
|
the average chi^2 if scaled is True.
|
|
840
851
|
|
|
852
|
+
|
|
841
853
|
Raises ValueError if ns uses a name that is already used for a
|
|
842
854
|
Parameter.
|
|
843
855
|
Raises ValueError if res depends on a Parameter that is not part of
|
|
@@ -1120,6 +1132,7 @@ def equationFromString(
|
|
|
1120
1132
|
Key word dictionary to pass to the argclass constructor
|
|
1121
1133
|
(default {}).
|
|
1122
1134
|
|
|
1135
|
+
|
|
1123
1136
|
Raises ValueError if ns uses a name that is already defined in the factory.
|
|
1124
1137
|
Raises ValueError if the equation has undefined parameters.
|
|
1125
1138
|
"""
|
|
@@ -47,6 +47,7 @@ class Restraint(Validatable):
|
|
|
47
47
|
the unrestrained point-average chi^2 (chi^2/numpoints)
|
|
48
48
|
(default False).
|
|
49
49
|
|
|
50
|
+
|
|
50
51
|
The penalty is calculated as
|
|
51
52
|
(max(0, lb - val, val - ub)/sig)**2
|
|
52
53
|
and val is the value of the calculated equation. This is multiplied by the
|
|
@@ -90,7 +91,10 @@ class Restraint(Validatable):
|
|
|
90
91
|
The point-average chi^2 which is optionally used to scale the
|
|
91
92
|
penalty (default 1.0).
|
|
92
93
|
|
|
93
|
-
Returns
|
|
94
|
+
Returns
|
|
95
|
+
-------
|
|
96
|
+
penalty
|
|
97
|
+
Returns the penalty as a float
|
|
94
98
|
"""
|
|
95
99
|
val = self.eq()
|
|
96
100
|
penalty = (max(0, self.lb - val, val - self.ub) / self.sig) ** 2
|
|
@@ -130,6 +130,7 @@ class SimpleRecipe(FitRecipe):
|
|
|
130
130
|
dyobs is None (default), it will be set to 1 at each
|
|
131
131
|
observed xobs.
|
|
132
132
|
|
|
133
|
+
|
|
133
134
|
Raises ValueError if len(yobs) != len(xobs)
|
|
134
135
|
Raises ValueError if dyobs != None and len(dyobs) != len(xobs)
|
|
135
136
|
"""
|
|
@@ -192,7 +193,7 @@ class SimpleRecipe(FitRecipe):
|
|
|
192
193
|
to by dy. Any other arrays are ignored. These are passed to
|
|
193
194
|
setObservedProfile.
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
Raises ValueError if the call to numpy.loadtxt returns fewer
|
|
196
197
|
than 2 arrays.
|
|
197
198
|
|
|
198
199
|
Returns the x, y and dy arrays loaded from the file
|
|
@@ -217,6 +218,7 @@ class SimpleRecipe(FitRecipe):
|
|
|
217
218
|
A dictionary of Parameters, indexed by name, that are used
|
|
218
219
|
in the eqstr, but not registered (default {}).
|
|
219
220
|
|
|
221
|
+
|
|
220
222
|
Raises ValueError if ns uses a name that is already used for a
|
|
221
223
|
variable.
|
|
222
224
|
"""
|
|
@@ -254,8 +256,10 @@ class SimpleRecipe(FitRecipe):
|
|
|
254
256
|
def saveResults(self, filename, header="", footer=""):
|
|
255
257
|
"""Format and save the results.
|
|
256
258
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
+
Parameters
|
|
260
|
+
----------
|
|
261
|
+
filename
|
|
262
|
+
Name of the save file.
|
|
259
263
|
header
|
|
260
264
|
A header to add to the output (default "")
|
|
261
265
|
footer
|
|
@@ -65,10 +65,9 @@ class BasePDFGenerator(ProfileGenerator):
|
|
|
65
65
|
Resolution peak broadening term
|
|
66
66
|
qdamp
|
|
67
67
|
Resolution peak dampening term
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
profile is named by the user.
|
|
68
|
+
Managed ParameterSets
|
|
69
|
+
The structure ParameterSet (SrRealParSet instance) used to
|
|
70
|
+
calculate the profile is named by the user.
|
|
72
71
|
|
|
73
72
|
Usable Metadata
|
|
74
73
|
---------------
|
{diffpy_srfit-3.2.0rc0 → diffpy_srfit-3.2.0rc2}/src/diffpy/srfit/pdf/characteristicfunctions.py
RENAMED
|
@@ -54,6 +54,7 @@ def sphericalCF(r, psize):
|
|
|
54
54
|
psize
|
|
55
55
|
The particle diameter
|
|
56
56
|
|
|
57
|
+
|
|
57
58
|
From Kodama et al., Acta Cryst. A, 62, 444-453
|
|
58
59
|
(converted from radius to diameter)
|
|
59
60
|
"""
|
|
@@ -78,6 +79,7 @@ def spheroidalCF(r, erad, prad):
|
|
|
78
79
|
erad
|
|
79
80
|
equatorial radius
|
|
80
81
|
|
|
82
|
+
|
|
81
83
|
erad < prad equates to a prolate spheroid
|
|
82
84
|
erad > prad equates to a oblate spheroid
|
|
83
85
|
erad == prad is a sphere
|
|
@@ -101,6 +103,7 @@ def spheroidalCF2(r, psize, axrat):
|
|
|
101
103
|
axrat
|
|
102
104
|
The ratio of axis lengths
|
|
103
105
|
|
|
106
|
+
|
|
104
107
|
From Lei et al., Phys. Rev. B, 80, 024118 (2009)
|
|
105
108
|
"""
|
|
106
109
|
pelpt = 1.0 * axrat
|
|
@@ -211,6 +214,7 @@ def lognormalSphericalCF(r, psize, psig):
|
|
|
211
214
|
psig
|
|
212
215
|
The log-normal width of the particle diameter
|
|
213
216
|
|
|
217
|
+
|
|
214
218
|
Here, r is the independent variable, mu is the mean of the distribution
|
|
215
219
|
(not of the particle size), and s is the width of the distribution. This is
|
|
216
220
|
the characteristic function for the lognormal distribution of particle
|
|
@@ -265,6 +269,7 @@ def sheetCF(r, sthick):
|
|
|
265
269
|
sthick
|
|
266
270
|
Thickness of nanosheet
|
|
267
271
|
|
|
272
|
+
|
|
268
273
|
From Kodama et al., Acta Cryst. A, 62, 444-453
|
|
269
274
|
"""
|
|
270
275
|
# handle zero or negative sthick. make it work for scalars and arrays.
|
|
@@ -294,6 +299,7 @@ def shellCF(r, radius, thickness):
|
|
|
294
299
|
thickness
|
|
295
300
|
Thickness of shell
|
|
296
301
|
|
|
302
|
+
|
|
297
303
|
outer radius = radius + thickness
|
|
298
304
|
|
|
299
305
|
From Lei et al., Phys. Rev. B, 80, 024118 (2009)
|
|
@@ -315,6 +321,7 @@ def shellCF2(r, a, delta):
|
|
|
315
321
|
|
|
316
322
|
outer radius = a + thickness/2
|
|
317
323
|
|
|
324
|
+
|
|
318
325
|
From Lei et al., Phys. Rev. B, 80, 024118 (2009)
|
|
319
326
|
"""
|
|
320
327
|
a = 1.0 * a
|
|
@@ -359,13 +366,12 @@ class SASCF(Calculator):
|
|
|
359
366
|
----------
|
|
360
367
|
_model
|
|
361
368
|
BaseModel object this adapts.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
dispersion.
|
|
369
|
+
Managed Parameters
|
|
370
|
+
These depend on the parameters of the BaseModel object held by _model.
|
|
371
|
+
They are created from the 'params' attribute of the BaseModel. If a
|
|
372
|
+
dispersion is set for the BaseModel, the dispersion "width" will be
|
|
373
|
+
accessible under "<parname>_width", where <parname> is the name a
|
|
374
|
+
parameter adjusted by dispersion.
|
|
369
375
|
"""
|
|
370
376
|
|
|
371
377
|
def __init__(self, name, model):
|
|
@@ -57,9 +57,9 @@ class DebyePDFGenerator(BasePDFGenerator):
|
|
|
57
57
|
qdamp
|
|
58
58
|
Resolution peak dampening term
|
|
59
59
|
|
|
60
|
-
Managed ParameterSets
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
Managed ParameterSets
|
|
61
|
+
The structure ParameterSet (SrRealStructure instance) used to calculate
|
|
62
|
+
the profile is named by the user.
|
|
63
63
|
|
|
64
64
|
Usable Metadata
|
|
65
65
|
---------------
|
|
@@ -201,6 +201,7 @@ class PDFContribution(FitContribution):
|
|
|
201
201
|
do not support periodicity, in which case this may be
|
|
202
202
|
ignored.
|
|
203
203
|
|
|
204
|
+
|
|
204
205
|
Returns the new phase (ParameterSet appropriate for what was passed in
|
|
205
206
|
stru.)
|
|
206
207
|
"""
|
|
@@ -245,6 +246,7 @@ class PDFContribution(FitContribution):
|
|
|
245
246
|
do not support periodicity, in which case this may be
|
|
246
247
|
ignored.
|
|
247
248
|
|
|
249
|
+
|
|
248
250
|
Returns the new phase (ParameterSet appropriate for what was passed in
|
|
249
251
|
stru.)
|
|
250
252
|
"""
|
|
@@ -56,10 +56,9 @@ class PDFGenerator(BasePDFGenerator):
|
|
|
56
56
|
Resolution peak broadening term
|
|
57
57
|
qdamp
|
|
58
58
|
Resolution peak dampening term
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
profile is named by the user.
|
|
59
|
+
Managed ParameterSets
|
|
60
|
+
The structure ParameterSet (SrRealStructure instance) used to
|
|
61
|
+
calculate the profile is named by the user.
|
|
63
62
|
|
|
64
63
|
Usable Metadata
|
|
65
64
|
---------------
|