diffpy.apps 0.2.0rc1__tar.gz → 0.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_apps-0.2.0rc1/src/diffpy.apps.egg-info → diffpy_apps-0.2.0rc2}/PKG-INFO +3 -3
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/pyproject.toml +2 -2
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/pdfadapter.py +7 -5
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/refinebase/parametric_model.py +2 -2
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/refinebase/refinement_session.py +2 -2
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2/src/diffpy.apps.egg-info}/PKG-INFO +3 -3
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/conftest.py +1 -1
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/helper.py +18 -18
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/test_pdfadapter.py +3 -1
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/AUTHORS.rst +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/LICENSE.rst +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/MANIFEST.in +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/README.rst +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/requirements/build.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/requirements/conda.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/requirements/docs.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/requirements/pip.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/requirements/tests.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/setup.cfg +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/__init__.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/__init__.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/app_agentify.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/app_runmacro.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/apps.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/refinebase/__init__.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/refinebase/refinement_server.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/version.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy.apps.egg-info/SOURCES.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy.apps.egg-info/dependency_links.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy.apps.egg-info/entry_points.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy.apps.egg-info/requires.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy.apps.egg-info/top_level.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/C60.gr +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/Ni.cif +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/Ni.gr +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/c60xyz.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/make_c60.txt +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/ni-q27r100-neutron.gr +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/ni-q27r60-xray.gr +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/pb.cif +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/pb_100_qmin1.gr +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/si-q27r60-xray.gr +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/si.cif +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/si90ni10-q27r60-xray.gr +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/data/sine.dat +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/test_agentify.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/test_parametric_model.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/test_refinement_server.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/test_refinement_session.py +0 -0
- {diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/tests/test_runmacro.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: diffpy.apps
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.0rc2
|
|
4
4
|
Summary: User applications to help with tasks using diffpy packages
|
|
5
5
|
Author-email: Yuchen Xiao <xiaoyuch@msu.edu>, Simon Billinge <sbillinge@ucsb.edu>
|
|
6
6
|
Maintainer-email: Simon Billinge <sbillinge@ucsb.edu>
|
|
@@ -16,12 +16,12 @@ Classifier: Operating System :: MacOS :: MacOS X
|
|
|
16
16
|
Classifier: Operating System :: Microsoft :: Windows
|
|
17
17
|
Classifier: Operating System :: POSIX
|
|
18
18
|
Classifier: Operating System :: Unix
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
23
23
|
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
24
|
-
Requires-Python: <3.
|
|
24
|
+
Requires-Python: <3.15,>=3.12
|
|
25
25
|
Description-Content-Type: text/x-rst
|
|
26
26
|
License-File: LICENSE.rst
|
|
27
27
|
License-File: AUTHORS.rst
|
|
@@ -15,7 +15,7 @@ maintainers = [
|
|
|
15
15
|
description = "User applications to help with tasks using diffpy packages"
|
|
16
16
|
keywords = ['diffraction', 'PDF', 'X-ray', 'neutron']
|
|
17
17
|
readme = "README.rst"
|
|
18
|
-
requires-python = ">=3.
|
|
18
|
+
requires-python = ">=3.12, <3.15"
|
|
19
19
|
classifiers = [
|
|
20
20
|
'Development Status :: 5 - Production/Stable',
|
|
21
21
|
'Environment :: Console',
|
|
@@ -25,9 +25,9 @@ classifiers = [
|
|
|
25
25
|
'Operating System :: Microsoft :: Windows',
|
|
26
26
|
'Operating System :: POSIX',
|
|
27
27
|
'Operating System :: Unix',
|
|
28
|
-
'Programming Language :: Python :: 3.11',
|
|
29
28
|
'Programming Language :: Python :: 3.12',
|
|
30
29
|
'Programming Language :: Python :: 3.13',
|
|
30
|
+
'Programming Language :: Python :: 3.14',
|
|
31
31
|
'Topic :: Scientific/Engineering :: Physics',
|
|
32
32
|
'Topic :: Scientific/Engineering :: Chemistry',
|
|
33
33
|
]
|
|
@@ -12,8 +12,8 @@ from diffpy.srfit.fitbase import (
|
|
|
12
12
|
Profile,
|
|
13
13
|
)
|
|
14
14
|
from diffpy.srfit.pdf import PDFGenerator, PDFParser
|
|
15
|
-
from diffpy.srfit.structure import
|
|
16
|
-
from diffpy.structure.parsers import
|
|
15
|
+
from diffpy.srfit.structure import constrain_as_space_group
|
|
16
|
+
from diffpy.structure.parsers import get_parser
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class PDFAdapter:
|
|
@@ -147,7 +147,7 @@ class PDFAdapter:
|
|
|
147
147
|
run_parallel = False
|
|
148
148
|
for i, structure_path in enumerate(structure_paths):
|
|
149
149
|
name = names[i] if names and i < len(names) else f"G{i+1}"
|
|
150
|
-
stru_parser =
|
|
150
|
+
stru_parser = get_parser("cif")
|
|
151
151
|
structure = stru_parser.parse(Path(structure_path).read_text())
|
|
152
152
|
sg = getattr(stru_parser, "spacegroup", None)
|
|
153
153
|
spacegroup = sg.short_name if sg is not None else "P1"
|
|
@@ -176,7 +176,7 @@ class PDFAdapter:
|
|
|
176
176
|
----------
|
|
177
177
|
equation : list of str, optional
|
|
178
178
|
The list of a single equation passed to
|
|
179
|
-
FitContribution.
|
|
179
|
+
FitContribution.set_equation
|
|
180
180
|
|
|
181
181
|
Returns
|
|
182
182
|
-------
|
|
@@ -220,7 +220,9 @@ class PDFAdapter:
|
|
|
220
220
|
recipe.add_constraint(pdfgenerator.qdamp, qdamp)
|
|
221
221
|
recipe.add_constraint(pdfgenerator.qbroad, qbroad)
|
|
222
222
|
stru_parset = pdfgenerator.phase
|
|
223
|
-
spacegroupparams =
|
|
223
|
+
spacegroupparams = constrain_as_space_group(
|
|
224
|
+
stru_parset, spacegroup
|
|
225
|
+
)
|
|
224
226
|
for par in spacegroupparams.xyzpars:
|
|
225
227
|
recipe.add_variable(
|
|
226
228
|
par, name=f"{pdfgenerator.name}_{par.name}", fixed=False
|
{diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/refinebase/parametric_model.py
RENAMED
|
@@ -644,8 +644,8 @@ def create_pdf_model_from_code(
|
|
|
644
644
|
if hasattr(structure, "GetCrystal")
|
|
645
645
|
else structure
|
|
646
646
|
)
|
|
647
|
-
if hasattr(crystal, "
|
|
648
|
-
spacegroup_symbol = crystal.
|
|
647
|
+
if hasattr(crystal, "get_space_group"):
|
|
648
|
+
spacegroup_symbol = crystal.get_space_group().get_name()
|
|
649
649
|
else:
|
|
650
650
|
logging.warning(
|
|
651
651
|
"Could not determine a space group for the structure named "
|
{diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/refinebase/refinement_session.py
RENAMED
|
@@ -67,7 +67,7 @@ class RefinementSession:
|
|
|
67
67
|
if profile_name is None:
|
|
68
68
|
profile_name = str(uuid.uuid4())
|
|
69
69
|
profile = Profile()
|
|
70
|
-
profile.
|
|
70
|
+
profile.set_observed_profile(xobs=xarray, yobs=yarray, dyobs=dy)
|
|
71
71
|
profile.xpar.name = xname
|
|
72
72
|
profile._xname = xname
|
|
73
73
|
profile.ypar.name = yname
|
|
@@ -531,7 +531,7 @@ class RefinementSession:
|
|
|
531
531
|
par = self.get_variable(eq_or_var_name)["obj"]
|
|
532
532
|
par.bound_range(lb, ub)
|
|
533
533
|
recipe.free("all")
|
|
534
|
-
leastsq(recipe.residual, recipe.
|
|
534
|
+
leastsq(recipe.residual, recipe.get_values())
|
|
535
535
|
# NOTE: non-scalar value will raise error in `get_results_string`
|
|
536
536
|
try:
|
|
537
537
|
result_string = FitResults(recipe).get_results_string()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: diffpy.apps
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.0rc2
|
|
4
4
|
Summary: User applications to help with tasks using diffpy packages
|
|
5
5
|
Author-email: Yuchen Xiao <xiaoyuch@msu.edu>, Simon Billinge <sbillinge@ucsb.edu>
|
|
6
6
|
Maintainer-email: Simon Billinge <sbillinge@ucsb.edu>
|
|
@@ -16,12 +16,12 @@ Classifier: Operating System :: MacOS :: MacOS X
|
|
|
16
16
|
Classifier: Operating System :: Microsoft :: Windows
|
|
17
17
|
Classifier: Operating System :: POSIX
|
|
18
18
|
Classifier: Operating System :: Unix
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
23
23
|
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
24
|
-
Requires-Python: <3.
|
|
24
|
+
Requires-Python: <3.15,>=3.12
|
|
25
25
|
Description-Content-Type: text/x-rst
|
|
26
26
|
License-File: LICENSE.rst
|
|
27
27
|
License-File: AUTHORS.rst
|
|
@@ -39,5 +39,5 @@ def sine_profile():
|
|
|
39
39
|
xobs = numpy.linspace(-numpy.pi, numpy.pi, 100)
|
|
40
40
|
yobs = numpy.sin(xobs) + 1e-3 * numpy.random.normal(size=xobs.shape)
|
|
41
41
|
sine_profile = Profile()
|
|
42
|
-
sine_profile.
|
|
42
|
+
sine_profile.set_observed_profile(xobs, yobs)
|
|
43
43
|
return sine_profile
|
|
@@ -10,8 +10,8 @@ from diffpy.srfit.fitbase import (
|
|
|
10
10
|
Profile,
|
|
11
11
|
)
|
|
12
12
|
from diffpy.srfit.pdf import DebyePDFGenerator, PDFGenerator, PDFParser
|
|
13
|
-
from diffpy.srfit.structure import
|
|
14
|
-
from diffpy.structure.parsers import
|
|
13
|
+
from diffpy.srfit.structure import constrain_as_space_group
|
|
14
|
+
from diffpy.structure.parsers import get_parser
|
|
15
15
|
|
|
16
16
|
_DATA_DIR = Path(__file__).parent / "data"
|
|
17
17
|
|
|
@@ -49,21 +49,21 @@ def run_ni_example():
|
|
|
49
49
|
QBROAD_I = 0.02
|
|
50
50
|
RUN_PARALLEL = True
|
|
51
51
|
|
|
52
|
-
p_cif =
|
|
53
|
-
stru1 = p_cif.
|
|
52
|
+
p_cif = get_parser("cif")
|
|
53
|
+
stru1 = p_cif.parse_file(structure_path)
|
|
54
54
|
sg = p_cif.spacegroup.short_name
|
|
55
55
|
profile = Profile()
|
|
56
56
|
parser = PDFParser()
|
|
57
|
-
parser.
|
|
58
|
-
profile.
|
|
59
|
-
profile.
|
|
57
|
+
parser.parse_file(profile_path)
|
|
58
|
+
profile.load_parsed_data(parser)
|
|
59
|
+
profile.set_calculation_range(xmin=PDF_RMIN, xmax=PDF_RMAX, dx=PDF_RSTEP)
|
|
60
60
|
generator_crystal1 = PDFGenerator("G1")
|
|
61
61
|
generator_crystal1.setStructure(stru1, periodic=True)
|
|
62
62
|
generator_crystal1.setQmax(QMAX)
|
|
63
63
|
generator_crystal1.setQmin(QMIN)
|
|
64
64
|
generator_crystal1.delta2.value = DELTA2_I
|
|
65
65
|
contribution = FitContribution("crystal")
|
|
66
|
-
contribution.
|
|
66
|
+
contribution.add_profile_generator(generator_crystal1)
|
|
67
67
|
if RUN_PARALLEL:
|
|
68
68
|
try:
|
|
69
69
|
import multiprocessing
|
|
@@ -82,28 +82,28 @@ def run_ni_example():
|
|
|
82
82
|
"\nYou don't appear to have the necessary packages for "
|
|
83
83
|
"parallelization"
|
|
84
84
|
)
|
|
85
|
-
contribution.
|
|
86
|
-
contribution.
|
|
85
|
+
contribution.set_profile(profile, xname="r")
|
|
86
|
+
contribution.set_equation("s0*G1")
|
|
87
87
|
recipe = FitRecipe()
|
|
88
|
-
recipe.
|
|
88
|
+
recipe.add_contribution(contribution)
|
|
89
89
|
recipe.crystal.G1.qdamp.value = QDAMP_I
|
|
90
90
|
recipe.crystal.G1.qbroad.value = QBROAD_I
|
|
91
91
|
recipe.crystal.G1.setQmax(QMAX)
|
|
92
92
|
recipe.crystal.G1.setQmin(QMIN)
|
|
93
|
-
recipe.
|
|
94
|
-
spacegroupparams =
|
|
93
|
+
recipe.add_variable(contribution.s0, SCALE_I, name="s0")
|
|
94
|
+
spacegroupparams = constrain_as_space_group(generator_crystal1.phase, sg)
|
|
95
95
|
for par in spacegroupparams.latpars:
|
|
96
|
-
recipe.
|
|
96
|
+
recipe.add_variable(par, value=CUBICLAT_I, fixed=False, name="G1_a")
|
|
97
97
|
for par in spacegroupparams.adppars:
|
|
98
|
-
recipe.
|
|
99
|
-
recipe.
|
|
100
|
-
recipe.
|
|
98
|
+
recipe.add_variable(par, value=UISO_I, fixed=False, name="G1_Uiso_0")
|
|
99
|
+
recipe.add_variable(generator_crystal1.delta2, name="G1_delta2")
|
|
100
|
+
recipe.add_variable(
|
|
101
101
|
generator_crystal1.qdamp,
|
|
102
102
|
fixed=False,
|
|
103
103
|
name="qdamp",
|
|
104
104
|
value=QDAMP_I,
|
|
105
105
|
)
|
|
106
|
-
recipe.
|
|
106
|
+
recipe.add_variable(
|
|
107
107
|
generator_crystal1.qbroad,
|
|
108
108
|
fixed=False,
|
|
109
109
|
name="qbroad",
|
|
@@ -37,7 +37,9 @@ def test_pdfadapter():
|
|
|
37
37
|
adapter.initialize_structures([str(structure_path)])
|
|
38
38
|
adapter.initialize_contribution(equation=["s0*G1"])
|
|
39
39
|
adapter.initialize_recipe()
|
|
40
|
-
adapter.recipe.
|
|
40
|
+
adapter.recipe.add_variable(
|
|
41
|
+
list(adapter.recipe._contributions.values())[0].s0
|
|
42
|
+
)
|
|
41
43
|
adapter.set_initial_variable_values(initial_pv_dict)
|
|
42
44
|
adapter.recipe.fix("all")
|
|
43
45
|
for var in variables_to_refine:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{diffpy_apps-0.2.0rc1 → diffpy_apps-0.2.0rc2}/src/diffpy/apps/refinebase/refinement_server.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|