easyreflectometry 1.2.0__tar.gz → 1.3.1__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.
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/PKG-INFO +29 -30
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/pyproject.toml +32 -31
- easyreflectometry-1.3.1/src/easyreflectometry/__version__.py +1 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/refl1d/wrapper.py +11 -11
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/refnx/wrapper.py +2 -2
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/wrapper_base.py +2 -2
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/data/__init__.py +4 -4
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/model/__init__.py +6 -6
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/model/model.py +7 -7
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/model/resolution_functions.py +4 -4
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/project.py +3 -3
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/__init__.py +14 -14
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/assemblies/repeating_multilayer.py +1 -1
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/assemblies/surfactant_layer.py +1 -1
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/elements/layers/layer.py +3 -3
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/elements/layers/layer_area_per_molecule.py +5 -5
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/elements/materials/material.py +5 -5
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/elements/materials/material_density.py +4 -4
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/elements/materials/material_mixture.py +1 -1
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/elements/materials/material_solvated.py +1 -1
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/summary/summary.py +1 -1
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/utils.py +1 -1
- easyreflectometry-1.2.0/src/easyreflectometry/__version__.py +0 -1
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/.gitignore +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/AUTHORS.rst +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/LICENSE +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/README.md +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/__init__.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/__init__.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/bornagain/calculator.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/bornagain/wrapper.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/calculator_base.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/factory.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/refl1d/calculator.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/refnx/calculator.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/data/data_store.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/data/measurement.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/fitting.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/main.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/model/model_collection.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/plot.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/assemblies/base_assembly.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/assemblies/gradient_layer.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/assemblies/multilayer.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/base_core.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/collections/base_collection.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/collections/layer_collection.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/collections/material_collection.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/collections/sample.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/special/calculations.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/special/parsing.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/summary/__init__.py +0 -0
- {easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/summary/html_templates.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: easyreflectometry
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: A reflectometry python package built on the EasyScience framework.
|
|
5
5
|
Project-URL: homepage, https://docs.easyreflectometry.org
|
|
6
6
|
Project-URL: documentation, https://docs.easyreflectometry.org
|
|
@@ -41,42 +41,41 @@ Classifier: License :: OSI Approved :: BSD License
|
|
|
41
41
|
Classifier: Operating System :: OS Independent
|
|
42
42
|
Classifier: Programming Language :: Python :: 3
|
|
43
43
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
44
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
45
44
|
Classifier: Programming Language :: Python :: 3.10
|
|
46
45
|
Classifier: Programming Language :: Python :: 3.11
|
|
47
46
|
Classifier: Programming Language :: Python :: 3.12
|
|
48
47
|
Classifier: Topic :: Scientific/Engineering
|
|
49
|
-
Requires-Python: <3.13,>=3.
|
|
50
|
-
Requires-Dist: easyscience
|
|
51
|
-
Requires-Dist: orsopy
|
|
52
|
-
Requires-Dist:
|
|
53
|
-
Requires-Dist:
|
|
54
|
-
Requires-Dist:
|
|
55
|
-
Requires-Dist:
|
|
56
|
-
Requires-Dist: xhtml2pdf>=0.2.16
|
|
48
|
+
Requires-Python: <3.13,>=3.10
|
|
49
|
+
Requires-Dist: easyscience==1.3.0
|
|
50
|
+
Requires-Dist: orsopy==1.2.1
|
|
51
|
+
Requires-Dist: refl1d[webview]==1.0.0a12
|
|
52
|
+
Requires-Dist: refnx==0.1.52
|
|
53
|
+
Requires-Dist: scipp==25.2.0
|
|
54
|
+
Requires-Dist: xhtml2pdf==0.2.17
|
|
57
55
|
Provides-Extra: dev
|
|
58
|
-
Requires-Dist: build; extra == 'dev'
|
|
59
|
-
Requires-Dist: codecov
|
|
60
|
-
Requires-Dist: coverage; extra == 'dev'
|
|
61
|
-
Requires-Dist: coveralls; extra == 'dev'
|
|
62
|
-
Requires-Dist: flake8
|
|
63
|
-
Requires-Dist: ipykernel; extra == 'dev'
|
|
64
|
-
Requires-Dist: jupyter
|
|
65
|
-
Requires-Dist: jupyterlab; extra == 'dev'
|
|
66
|
-
Requires-Dist: plopp; extra == 'dev'
|
|
67
|
-
Requires-Dist: pooch; extra == 'dev'
|
|
68
|
-
Requires-Dist: pytest-cov
|
|
69
|
-
Requires-Dist: pytest
|
|
70
|
-
Requires-Dist: ruff; extra == 'dev'
|
|
71
|
-
Requires-Dist: toml
|
|
72
|
-
Requires-Dist: yapf
|
|
56
|
+
Requires-Dist: build==1.2.2.post1; extra == 'dev'
|
|
57
|
+
Requires-Dist: codecov==2.1.13; extra == 'dev'
|
|
58
|
+
Requires-Dist: coverage==7.7.0; extra == 'dev'
|
|
59
|
+
Requires-Dist: coveralls==4.0.1; extra == 'dev'
|
|
60
|
+
Requires-Dist: flake8==7.1.2; extra == 'dev'
|
|
61
|
+
Requires-Dist: ipykernel==6.29.5; extra == 'dev'
|
|
62
|
+
Requires-Dist: jupyter==1.1.1; extra == 'dev'
|
|
63
|
+
Requires-Dist: jupyterlab==4.3.6; extra == 'dev'
|
|
64
|
+
Requires-Dist: plopp==25.3.0; extra == 'dev'
|
|
65
|
+
Requires-Dist: pooch==1.8.2; extra == 'dev'
|
|
66
|
+
Requires-Dist: pytest-cov==6.0.0; extra == 'dev'
|
|
67
|
+
Requires-Dist: pytest==8.3.5; extra == 'dev'
|
|
68
|
+
Requires-Dist: ruff==0.11.0; extra == 'dev'
|
|
69
|
+
Requires-Dist: toml==0.10.2; extra == 'dev'
|
|
70
|
+
Requires-Dist: yapf==0.43.0; extra == 'dev'
|
|
73
71
|
Provides-Extra: docs
|
|
74
|
-
Requires-Dist: myst-parser; extra == 'docs'
|
|
75
|
-
Requires-Dist: nbsphinx; extra == 'docs'
|
|
72
|
+
Requires-Dist: myst-parser==4.0.1; extra == 'docs'
|
|
73
|
+
Requires-Dist: nbsphinx==0.9.7; extra == 'docs'
|
|
74
|
+
Requires-Dist: sphinx; extra == 'docs'
|
|
76
75
|
Requires-Dist: sphinx-autodoc-typehints; extra == 'docs'
|
|
77
|
-
Requires-Dist: sphinx-book-theme; extra == 'docs'
|
|
78
|
-
Requires-Dist: sphinx-copybutton; extra == 'docs'
|
|
79
|
-
Requires-Dist: toml; extra == 'docs'
|
|
76
|
+
Requires-Dist: sphinx-book-theme==1.1.4; extra == 'docs'
|
|
77
|
+
Requires-Dist: sphinx-copybutton==0.5.2; extra == 'docs'
|
|
78
|
+
Requires-Dist: toml==0.10.2; extra == 'docs'
|
|
80
79
|
Description-Content-Type: text/markdown
|
|
81
80
|
|
|
82
81
|

|
|
@@ -21,48 +21,50 @@ classifiers = [
|
|
|
21
21
|
"Topic :: Scientific/Engineering",
|
|
22
22
|
"Programming Language :: Python :: 3",
|
|
23
23
|
"Programming Language :: Python :: 3 :: Only",
|
|
24
|
-
"Programming Language :: Python :: 3.9",
|
|
25
24
|
"Programming Language :: Python :: 3.10",
|
|
26
25
|
"Programming Language :: Python :: 3.11",
|
|
27
26
|
"Programming Language :: Python :: 3.12",
|
|
28
27
|
"Development Status :: 3 - Alpha"
|
|
29
28
|
]
|
|
30
|
-
|
|
29
|
+
|
|
30
|
+
requires-python = ">=3.10,<3.13"
|
|
31
|
+
|
|
31
32
|
dependencies = [
|
|
32
|
-
"easyscience
|
|
33
|
-
"scipp
|
|
34
|
-
"refnx
|
|
35
|
-
"refl1d
|
|
36
|
-
"orsopy
|
|
37
|
-
"
|
|
38
|
-
"xhtml2pdf>=0.2.16"
|
|
33
|
+
"easyscience==1.3.0",
|
|
34
|
+
"scipp==25.2.0",
|
|
35
|
+
"refnx==0.1.52",
|
|
36
|
+
"refl1d[webview]==1.0.0a12",
|
|
37
|
+
"orsopy==1.2.1",
|
|
38
|
+
"xhtml2pdf==0.2.17",
|
|
39
39
|
]
|
|
40
40
|
|
|
41
41
|
[project.optional-dependencies]
|
|
42
42
|
dev = [
|
|
43
|
-
"build",
|
|
44
|
-
"codecov
|
|
45
|
-
"coverage",
|
|
46
|
-
"coveralls",
|
|
47
|
-
"flake8
|
|
48
|
-
"ipykernel",
|
|
49
|
-
"jupyter
|
|
50
|
-
"jupyterlab",
|
|
51
|
-
"plopp",
|
|
52
|
-
"pooch",
|
|
53
|
-
"pytest
|
|
54
|
-
"pytest-cov
|
|
55
|
-
"ruff",
|
|
56
|
-
"toml
|
|
57
|
-
"yapf
|
|
43
|
+
"build==1.2.2.post1",
|
|
44
|
+
"codecov==2.1.13",
|
|
45
|
+
"coverage==7.7.0",
|
|
46
|
+
"coveralls==4.0.1",
|
|
47
|
+
"flake8==7.1.2",
|
|
48
|
+
"ipykernel==6.29.5",
|
|
49
|
+
"jupyter==1.1.1",
|
|
50
|
+
"jupyterlab==4.3.6",
|
|
51
|
+
"plopp==25.3.0",
|
|
52
|
+
"pooch==1.8.2",
|
|
53
|
+
"pytest==8.3.5",
|
|
54
|
+
"pytest-cov==6.0.0",
|
|
55
|
+
"ruff==0.11.0",
|
|
56
|
+
"toml==0.10.2",
|
|
57
|
+
"yapf==0.43.0",
|
|
58
58
|
]
|
|
59
|
+
|
|
59
60
|
docs = [
|
|
60
|
-
"myst_parser",
|
|
61
|
-
"nbsphinx",
|
|
61
|
+
"myst_parser==4.0.1",
|
|
62
|
+
"nbsphinx==0.9.7",
|
|
63
|
+
"sphinx",
|
|
62
64
|
"sphinx_autodoc_typehints",
|
|
63
|
-
"
|
|
64
|
-
"sphinx-copybutton",
|
|
65
|
-
"toml"
|
|
65
|
+
"sphinx-book-theme==1.1.4",
|
|
66
|
+
"sphinx-copybutton==0.5.2",
|
|
67
|
+
"toml==0.10.2",
|
|
66
68
|
]
|
|
67
69
|
|
|
68
70
|
[project.urls]
|
|
@@ -131,10 +133,9 @@ force-single-line = true
|
|
|
131
133
|
legacy_tox_ini = """
|
|
132
134
|
[tox]
|
|
133
135
|
isolated_build = True
|
|
134
|
-
envlist = py{3.
|
|
136
|
+
envlist = py{3.10,3.11,3.12}
|
|
135
137
|
[gh-actions]
|
|
136
138
|
python =
|
|
137
|
-
3.9: py39
|
|
138
139
|
3.10: py310
|
|
139
140
|
3.11: py311
|
|
140
141
|
3.12: py312
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.3.1'
|
|
@@ -3,10 +3,10 @@ __author__ = 'github.com/arm61'
|
|
|
3
3
|
from typing import Tuple
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
|
-
from refl1d import model
|
|
7
6
|
from refl1d import names
|
|
7
|
+
from refl1d.sample.layers import Repeat
|
|
8
8
|
|
|
9
|
-
from easyreflectometry.model import
|
|
9
|
+
from easyreflectometry.model import PercentageFwhm
|
|
10
10
|
|
|
11
11
|
from ..wrapper_base import WrapperBase
|
|
12
12
|
|
|
@@ -34,7 +34,7 @@ class Refl1dWrapper(WrapperBase):
|
|
|
34
34
|
magnetism = names.Magnetism(rhoM=0.0, thetaM=0.0)
|
|
35
35
|
else:
|
|
36
36
|
magnetism = None
|
|
37
|
-
self.storage['layer'][name] =
|
|
37
|
+
self.storage['layer'][name] = names.Slab(name=str(name), magnetism=magnetism)
|
|
38
38
|
|
|
39
39
|
def create_item(self, name: str):
|
|
40
40
|
"""
|
|
@@ -42,8 +42,8 @@ class Refl1dWrapper(WrapperBase):
|
|
|
42
42
|
|
|
43
43
|
:param name: The name of the item
|
|
44
44
|
"""
|
|
45
|
-
self.storage['item'][name] =
|
|
46
|
-
|
|
45
|
+
self.storage['item'][name] = Repeat(
|
|
46
|
+
names.Stack(names.Slab(names.SLD(), thickness=0, interface=0)), name=str(name)
|
|
47
47
|
)
|
|
48
48
|
del self.storage['item'][name].stack[0]
|
|
49
49
|
|
|
@@ -66,7 +66,7 @@ class Refl1dWrapper(WrapperBase):
|
|
|
66
66
|
:param key: The given value keys
|
|
67
67
|
"""
|
|
68
68
|
if key in ['magnetism_rhoM', 'magnetism_thetaM']:
|
|
69
|
-
return getattr(self.storage['layer'][name].magnetism, key.split('_')[-1])
|
|
69
|
+
return getattr(self.storage['layer'][name].magnetism, key.split('_')[-1]).value #TODO: check if we want to return the raw value or the full Parameter # noqa: E501
|
|
70
70
|
return super().get_layer_value(name, key)
|
|
71
71
|
|
|
72
72
|
def create_model(self, name: str):
|
|
@@ -157,7 +157,7 @@ class Refl1dWrapper(WrapperBase):
|
|
|
157
157
|
sample = _build_sample(self.storage, model_name)
|
|
158
158
|
dq_array = self._resolution_function.smearing(q_array)
|
|
159
159
|
|
|
160
|
-
if isinstance(self._resolution_function,
|
|
160
|
+
if isinstance(self._resolution_function, PercentageFwhm):
|
|
161
161
|
# Get percentage of Q and change from sigma to FWHM
|
|
162
162
|
dq_array = dq_array * q_array / 100 / (2 * np.sqrt(2 * np.log(2)))
|
|
163
163
|
|
|
@@ -267,8 +267,8 @@ def _get_polarized_probe(
|
|
|
267
267
|
return names.PolarizedQProbe(xs=four_probes, name='polarized')
|
|
268
268
|
|
|
269
269
|
|
|
270
|
-
def _build_sample(storage: dict, model_name: str) ->
|
|
271
|
-
sample =
|
|
270
|
+
def _build_sample(storage: dict, model_name: str) -> names.Stack:
|
|
271
|
+
sample = names.Stack()
|
|
272
272
|
# -1 to reverse the order
|
|
273
273
|
for i in storage['model'][model_name]['items'][::-1]:
|
|
274
274
|
if i.repeat.value == 1:
|
|
@@ -276,9 +276,9 @@ def _build_sample(storage: dict, model_name: str) -> model.Stack:
|
|
|
276
276
|
for j in range(len(i.stack))[::-1]:
|
|
277
277
|
sample |= i.stack[j]
|
|
278
278
|
else:
|
|
279
|
-
stack =
|
|
279
|
+
stack = names.Stack()
|
|
280
280
|
# -1 to reverse the order
|
|
281
281
|
for j in range(len(i.stack))[::-1]:
|
|
282
282
|
stack |= i.stack[j]
|
|
283
|
-
sample |=
|
|
283
|
+
sample |= Repeat(stack, repeat=i.repeat.value)
|
|
284
284
|
return sample
|
|
@@ -5,7 +5,7 @@ from typing import Tuple
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
from refnx import reflect
|
|
7
7
|
|
|
8
|
-
from easyreflectometry.model import
|
|
8
|
+
from easyreflectometry.model import PercentageFwhm
|
|
9
9
|
|
|
10
10
|
from ..wrapper_base import WrapperBase
|
|
11
11
|
|
|
@@ -143,7 +143,7 @@ class RefnxWrapper(WrapperBase):
|
|
|
143
143
|
)
|
|
144
144
|
|
|
145
145
|
dq_vector = self._resolution_function.smearing(q_array)
|
|
146
|
-
if isinstance(self._resolution_function,
|
|
146
|
+
if isinstance(self._resolution_function, PercentageFwhm):
|
|
147
147
|
# FWHM Percentage resolution is constant given as
|
|
148
148
|
# For a constant resolution percentage refnx supports to pass a scalar value rather than a vector
|
|
149
149
|
dq_vector = dq_vector[0]
|
|
@@ -2,7 +2,7 @@ from abc import abstractmethod
|
|
|
2
2
|
|
|
3
3
|
import numpy as np
|
|
4
4
|
|
|
5
|
-
from easyreflectometry.model import
|
|
5
|
+
from easyreflectometry.model import PercentageFwhm
|
|
6
6
|
from easyreflectometry.model import ResolutionFunction
|
|
7
7
|
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ class WrapperBase:
|
|
|
16
16
|
'item': {},
|
|
17
17
|
'model': {},
|
|
18
18
|
}
|
|
19
|
-
self._resolution_function =
|
|
19
|
+
self._resolution_function = PercentageFwhm()
|
|
20
20
|
|
|
21
21
|
def reset_storage(self):
|
|
22
22
|
"""Reset the storage area to blank."""
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
from .model import Model
|
|
2
2
|
from .model_collection import ModelCollection
|
|
3
3
|
from .resolution_functions import LinearSpline
|
|
4
|
-
from .resolution_functions import
|
|
4
|
+
from .resolution_functions import PercentageFwhm
|
|
5
5
|
from .resolution_functions import ResolutionFunction
|
|
6
6
|
|
|
7
7
|
__all__ = (
|
|
8
|
-
LinearSpline,
|
|
9
|
-
|
|
10
|
-
ResolutionFunction,
|
|
11
|
-
Model,
|
|
12
|
-
ModelCollection,
|
|
8
|
+
"LinearSpline",
|
|
9
|
+
"PercentageFwhm",
|
|
10
|
+
"ResolutionFunction",
|
|
11
|
+
"Model",
|
|
12
|
+
"ModelCollection",
|
|
13
13
|
)
|
|
@@ -9,15 +9,15 @@ from typing import Union
|
|
|
9
9
|
|
|
10
10
|
import numpy as np
|
|
11
11
|
from easyscience import global_object
|
|
12
|
-
from easyscience.Objects.new_variable import Parameter
|
|
13
12
|
from easyscience.Objects.ObjectClasses import BaseObj
|
|
13
|
+
from easyscience.Objects.variable import Parameter
|
|
14
14
|
|
|
15
15
|
from easyreflectometry.sample import BaseAssembly
|
|
16
16
|
from easyreflectometry.sample import Sample
|
|
17
17
|
from easyreflectometry.utils import get_as_parameter
|
|
18
18
|
from easyreflectometry.utils import yaml_dump
|
|
19
19
|
|
|
20
|
-
from .resolution_functions import
|
|
20
|
+
from .resolution_functions import PercentageFwhm
|
|
21
21
|
from .resolution_functions import ResolutionFunction
|
|
22
22
|
|
|
23
23
|
DEFAULTS = {
|
|
@@ -26,7 +26,7 @@ DEFAULTS = {
|
|
|
26
26
|
'url': 'https://github.com/reflectivity/edu_outreach/blob/master/refl_maths/paper.tex',
|
|
27
27
|
'value': 1.0,
|
|
28
28
|
'min': 0,
|
|
29
|
-
'max': np.
|
|
29
|
+
'max': np.inf,
|
|
30
30
|
'fixed': True,
|
|
31
31
|
},
|
|
32
32
|
'background': {
|
|
@@ -34,7 +34,7 @@ DEFAULTS = {
|
|
|
34
34
|
'url': 'https://github.com/reflectivity/edu_outreach/blob/master/refl_maths/paper.tex',
|
|
35
35
|
'value': 1e-8,
|
|
36
36
|
'min': 0.0,
|
|
37
|
-
'max': np.
|
|
37
|
+
'max': np.inf,
|
|
38
38
|
'fixed': True,
|
|
39
39
|
},
|
|
40
40
|
'resolution': {
|
|
@@ -71,7 +71,7 @@ class Model(BaseObj):
|
|
|
71
71
|
:param scale: Scaling factor of profile.
|
|
72
72
|
:param background: Linear background magnitude.
|
|
73
73
|
:param name: Name of the model, defaults to 'EasyModel'.
|
|
74
|
-
:param resolution_function: Resolution function, defaults to
|
|
74
|
+
:param resolution_function: Resolution function, defaults to PercentageFwhm.
|
|
75
75
|
:param interface: Calculator interface, defaults to `None`.
|
|
76
76
|
|
|
77
77
|
"""
|
|
@@ -81,7 +81,7 @@ class Model(BaseObj):
|
|
|
81
81
|
if sample is None:
|
|
82
82
|
sample = Sample(interface=interface)
|
|
83
83
|
if resolution_function is None:
|
|
84
|
-
resolution_function =
|
|
84
|
+
resolution_function = PercentageFwhm(DEFAULTS['resolution']['value'])
|
|
85
85
|
|
|
86
86
|
scale = get_as_parameter('scale', scale, DEFAULTS)
|
|
87
87
|
background = get_as_parameter('background', background, DEFAULTS)
|
|
@@ -168,7 +168,7 @@ class Model(BaseObj):
|
|
|
168
168
|
@property
|
|
169
169
|
def _dict_repr(self) -> dict[str, dict[str, str]]:
|
|
170
170
|
"""A simplified dict representation."""
|
|
171
|
-
if isinstance(self._resolution_function,
|
|
171
|
+
if isinstance(self._resolution_function, PercentageFwhm):
|
|
172
172
|
resolution_value = self._resolution_function.as_dict()['constant']
|
|
173
173
|
resolution = f'{resolution_value} %'
|
|
174
174
|
else:
|
|
@@ -26,14 +26,14 @@ class ResolutionFunction:
|
|
|
26
26
|
|
|
27
27
|
@classmethod
|
|
28
28
|
def from_dict(cls, data: dict) -> ResolutionFunction:
|
|
29
|
-
if data['smearing'] == '
|
|
30
|
-
return
|
|
29
|
+
if data['smearing'] == 'PercentageFwhm':
|
|
30
|
+
return PercentageFwhm(data['constant'])
|
|
31
31
|
if data['smearing'] == 'LinearSpline':
|
|
32
32
|
return LinearSpline(data['q_data_points'], data['fwhm_values'])
|
|
33
33
|
raise ValueError('Unknown resolution function type')
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
class
|
|
36
|
+
class PercentageFwhm(ResolutionFunction):
|
|
37
37
|
def __init__(self, constant: Union[None, float] = None):
|
|
38
38
|
if constant is None:
|
|
39
39
|
constant = DEFAULT_RESOLUTION_FWHM_PERCENTAGE
|
|
@@ -45,7 +45,7 @@ class PercentageFhwm(ResolutionFunction):
|
|
|
45
45
|
def as_dict(
|
|
46
46
|
self, skip: Optional[List[str]] = None
|
|
47
47
|
) -> dict[str, str]: # skip is kept for consistency of the as_dict signature
|
|
48
|
-
return {'smearing': '
|
|
48
|
+
return {'smearing': 'PercentageFwhm', 'constant': self.constant}
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
class LinearSpline(ResolutionFunction):
|
|
@@ -11,7 +11,7 @@ import numpy as np
|
|
|
11
11
|
from easyscience import global_object
|
|
12
12
|
from easyscience.fitting import AvailableMinimizers
|
|
13
13
|
from easyscience.fitting.fitter import DEFAULT_MINIMIZER
|
|
14
|
-
from easyscience.Objects.
|
|
14
|
+
from easyscience.Objects.variable import Parameter
|
|
15
15
|
from scipp import DataGroup
|
|
16
16
|
|
|
17
17
|
from easyreflectometry.calculators import CalculatorFactory
|
|
@@ -21,7 +21,7 @@ from easyreflectometry.fitting import MultiFitter
|
|
|
21
21
|
from easyreflectometry.model import LinearSpline
|
|
22
22
|
from easyreflectometry.model import Model
|
|
23
23
|
from easyreflectometry.model import ModelCollection
|
|
24
|
-
from easyreflectometry.model import
|
|
24
|
+
from easyreflectometry.model import PercentageFwhm
|
|
25
25
|
from easyreflectometry.sample import Layer
|
|
26
26
|
from easyreflectometry.sample import Material
|
|
27
27
|
from easyreflectometry.sample import MaterialCollection
|
|
@@ -266,7 +266,7 @@ class Project:
|
|
|
266
266
|
|
|
267
267
|
def sample_data_for_model_at_index(self, index: int = 0, q_range: Optional[np.array] = None) -> DataSet1D:
|
|
268
268
|
original_resolution_function = self.models[index].resolution_function
|
|
269
|
-
self.models[index].resolution_function =
|
|
269
|
+
self.models[index].resolution_function = PercentageFwhm(0)
|
|
270
270
|
reflectivity_data = self.model_data_for_model_at_index(index, q_range)
|
|
271
271
|
self.models[index].resolution_function = original_resolution_function
|
|
272
272
|
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/__init__.py
RENAMED
|
@@ -14,18 +14,18 @@ from .elements.materials.material_mixture import MaterialMixture
|
|
|
14
14
|
from .elements.materials.material_solvated import MaterialSolvated
|
|
15
15
|
|
|
16
16
|
__all__ = (
|
|
17
|
-
BaseAssembly,
|
|
18
|
-
GradientLayer,
|
|
19
|
-
Layer,
|
|
20
|
-
LayerAreaPerMolecule,
|
|
21
|
-
LayerCollection,
|
|
22
|
-
Material,
|
|
23
|
-
MaterialCollection,
|
|
24
|
-
MaterialDensity,
|
|
25
|
-
MaterialMixture,
|
|
26
|
-
MaterialSolvated,
|
|
27
|
-
Multilayer,
|
|
28
|
-
RepeatingMultilayer,
|
|
29
|
-
Sample,
|
|
30
|
-
SurfactantLayer,
|
|
17
|
+
"BaseAssembly",
|
|
18
|
+
"GradientLayer",
|
|
19
|
+
"Layer",
|
|
20
|
+
"LayerAreaPerMolecule",
|
|
21
|
+
"LayerCollection",
|
|
22
|
+
"Material",
|
|
23
|
+
"MaterialCollection",
|
|
24
|
+
"MaterialDensity",
|
|
25
|
+
"MaterialMixture",
|
|
26
|
+
"MaterialSolvated",
|
|
27
|
+
"Multilayer",
|
|
28
|
+
"RepeatingMultilayer",
|
|
29
|
+
"Sample",
|
|
30
|
+
"SurfactantLayer",
|
|
31
31
|
)
|
|
@@ -4,7 +4,7 @@ from typing import Optional
|
|
|
4
4
|
|
|
5
5
|
from easyscience import global_object
|
|
6
6
|
from easyscience.Constraints import ObjConstraint
|
|
7
|
-
from easyscience.Objects.
|
|
7
|
+
from easyscience.Objects.variable import Parameter
|
|
8
8
|
|
|
9
9
|
from ..collections.layer_collection import LayerCollection
|
|
10
10
|
from ..elements.layers.layer_area_per_molecule import LayerAreaPerMolecule
|
|
@@ -4,7 +4,7 @@ from typing import Union
|
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
from easyscience import global_object
|
|
7
|
-
from easyscience.Objects.
|
|
7
|
+
from easyscience.Objects.variable import Parameter
|
|
8
8
|
|
|
9
9
|
from easyreflectometry.utils import get_as_parameter
|
|
10
10
|
|
|
@@ -18,7 +18,7 @@ DEFAULTS = {
|
|
|
18
18
|
'value': 10.0,
|
|
19
19
|
'unit': 'angstrom',
|
|
20
20
|
'min': 0.0,
|
|
21
|
-
'max': np.
|
|
21
|
+
'max': np.inf,
|
|
22
22
|
'fixed': True,
|
|
23
23
|
},
|
|
24
24
|
'roughness': {
|
|
@@ -27,7 +27,7 @@ DEFAULTS = {
|
|
|
27
27
|
'value': 3.3,
|
|
28
28
|
'unit': 'angstrom',
|
|
29
29
|
'min': 0.0,
|
|
30
|
-
'max': np.
|
|
30
|
+
'max': np.inf,
|
|
31
31
|
'fixed': True,
|
|
32
32
|
},
|
|
33
33
|
}
|
|
@@ -4,7 +4,7 @@ from typing import Union
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
from easyscience import global_object
|
|
6
6
|
from easyscience.Constraints import FunctionalConstraint
|
|
7
|
-
from easyscience.Objects.
|
|
7
|
+
from easyscience.Objects.variable import Parameter
|
|
8
8
|
|
|
9
9
|
from easyreflectometry.special.calculations import area_per_molecule_to_scattering_length_density
|
|
10
10
|
from easyreflectometry.special.calculations import neutron_scattering_length
|
|
@@ -31,8 +31,8 @@ DEFAULTS = {
|
|
|
31
31
|
'url': 'https://www.ncnr.nist.gov/resources/activation/',
|
|
32
32
|
'value': 4.186,
|
|
33
33
|
'unit': 'angstrom',
|
|
34
|
-
'min': -np.
|
|
35
|
-
'max': np.
|
|
34
|
+
'min': -np.inf,
|
|
35
|
+
'max': np.inf,
|
|
36
36
|
'fixed': True,
|
|
37
37
|
},
|
|
38
38
|
'isl': {
|
|
@@ -40,8 +40,8 @@ DEFAULTS = {
|
|
|
40
40
|
'url': 'https://www.ncnr.nist.gov/resources/activation/',
|
|
41
41
|
'value': 0.0,
|
|
42
42
|
'unit': 'angstrom',
|
|
43
|
-
'min': -np.
|
|
44
|
-
'max': np.
|
|
43
|
+
'min': -np.inf,
|
|
44
|
+
'max': np.inf,
|
|
45
45
|
'fixed': True,
|
|
46
46
|
},
|
|
47
47
|
}
|
|
@@ -5,7 +5,7 @@ from typing import Union
|
|
|
5
5
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
from easyscience import global_object
|
|
8
|
-
from easyscience.Objects.
|
|
8
|
+
from easyscience.Objects.variable import Parameter
|
|
9
9
|
|
|
10
10
|
from easyreflectometry.utils import get_as_parameter
|
|
11
11
|
|
|
@@ -17,8 +17,8 @@ DEFAULTS = {
|
|
|
17
17
|
'url': 'https://www.ncnr.nist.gov/resources/activation/',
|
|
18
18
|
'value': 4.186,
|
|
19
19
|
'unit': '1 / angstrom^2',
|
|
20
|
-
'min': -np.
|
|
21
|
-
'max': np.
|
|
20
|
+
'min': -np.inf,
|
|
21
|
+
'max': np.inf,
|
|
22
22
|
'fixed': True,
|
|
23
23
|
},
|
|
24
24
|
'isld': {
|
|
@@ -26,8 +26,8 @@ DEFAULTS = {
|
|
|
26
26
|
'url': 'https://www.ncnr.nist.gov/resources/activation/',
|
|
27
27
|
'value': 0.0,
|
|
28
28
|
'unit': '1 / angstrom^2',
|
|
29
|
-
'min': -np.
|
|
30
|
-
'max': np.
|
|
29
|
+
'min': -np.inf,
|
|
30
|
+
'max': np.inf,
|
|
31
31
|
'fixed': True,
|
|
32
32
|
},
|
|
33
33
|
}
|
|
@@ -4,7 +4,7 @@ from typing import Union
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
from easyscience import global_object
|
|
6
6
|
from easyscience.Constraints import FunctionalConstraint
|
|
7
|
-
from easyscience.Objects.
|
|
7
|
+
from easyscience.Objects.variable import Parameter
|
|
8
8
|
|
|
9
9
|
from easyreflectometry.special.calculations import density_to_sld
|
|
10
10
|
from easyreflectometry.special.calculations import molecular_weight
|
|
@@ -22,7 +22,7 @@ DEFAULTS = {
|
|
|
22
22
|
'value': 2.33,
|
|
23
23
|
'unit': 'gram / centimeter ** 3',
|
|
24
24
|
'min': 0,
|
|
25
|
-
'max': np.
|
|
25
|
+
'max': np.inf,
|
|
26
26
|
'fixed': True,
|
|
27
27
|
},
|
|
28
28
|
'molecular_weight': {
|
|
@@ -30,8 +30,8 @@ DEFAULTS = {
|
|
|
30
30
|
'url': 'https://en.wikipedia.org/wiki/Molecular_mass',
|
|
31
31
|
'value': 28.02,
|
|
32
32
|
'unit': 'g / mole',
|
|
33
|
-
'min': -np.
|
|
34
|
-
'max': np.
|
|
33
|
+
'min': -np.inf,
|
|
34
|
+
'max': np.inf,
|
|
35
35
|
'fixed': True,
|
|
36
36
|
},
|
|
37
37
|
}
|
|
@@ -3,7 +3,7 @@ from typing import Union
|
|
|
3
3
|
|
|
4
4
|
from easyscience import global_object
|
|
5
5
|
from easyscience.Constraints import FunctionalConstraint
|
|
6
|
-
from easyscience.Objects.
|
|
6
|
+
from easyscience.Objects.variable import Parameter
|
|
7
7
|
|
|
8
8
|
from easyreflectometry.special.calculations import weighted_average
|
|
9
9
|
from easyreflectometry.utils import get_as_parameter
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/summary/summary.py
RENAMED
|
@@ -144,7 +144,7 @@ class Summary:
|
|
|
144
144
|
experiment_name = experiment.name
|
|
145
145
|
num_data_points = len(experiment.x)
|
|
146
146
|
resolution_function = self._project.models[idx].resolution_function.as_dict()['smearing']
|
|
147
|
-
if resolution_function == '
|
|
147
|
+
if resolution_function == 'PercentageFwhm':
|
|
148
148
|
precentage = self._project.models[idx].resolution_function.as_dict()['constant']
|
|
149
149
|
resolution_function = f'{resolution_function} {precentage}%'
|
|
150
150
|
range_min = min(experiment.y)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.2.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/calculators/factory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/data/data_store.py
RENAMED
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/data/measurement.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/model/model_collection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/sample/base_core.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/special/calculations.py
RENAMED
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/special/parsing.py
RENAMED
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/summary/__init__.py
RENAMED
|
File without changes
|
{easyreflectometry-1.2.0 → easyreflectometry-1.3.1}/src/easyreflectometry/summary/html_templates.py
RENAMED
|
File without changes
|