Skip to content

Commit f0b909a

Browse files
authored
Merge pull request #262 from easyscience/develop
Release 1.4
2 parents c24af81 + 6be3fb8 commit f0b909a

61 files changed

Lines changed: 629 additions & 440 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/documentation-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up Python
3535
uses: actions/setup-python@v5
3636
with:
37-
python-version: 3.10.12
37+
python-version: 3.11
3838
- name: Install Pandoc, repo and dependencies
3939
run: |
4040
sudo apt install pandoc

.github/workflows/python-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
max-parallel: 4
3232
matrix:
33-
python-version: ['3.10', '3.11', '3.12']
33+
python-version: ['3.11', '3.12']
3434
os: [ubuntu-latest, macos-latest, windows-latest]
3535

3636
runs-on: ${{ matrix.os }}

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
python-version: ['3.10', '3.11','3.12']
21+
python-version: ['3.11','3.12']
2222
if: "!contains(github.event.head_commit.message, '[ci skip]')"
2323

2424
steps:

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Before you submit a pull request, check that it meets these guidelines:
102102
2. If the pull request adds functionality, the docs should be updated. Put
103103
your new functionality into a function with a docstring, and add the
104104
feature to the list in README.md.
105-
3. The pull request should work for Python, 3.10, 3.11 and 3.12, and for PyPy. Check
105+
3. The pull request should work for Python, 3.11 and 3.12, and for PyPy. Check
106106
https://travis-ci.com/easyScience/EasyReflectometryLib/pull_requests
107107
and make sure that the tests pass for all supported Python versions.
108108

docs/src/tutorials/advancedfitting/multi_contrast.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@
358358
"d83acmw.head_layer.area_per_molecule_parameter.enabled = True\n",
359359
"d83acmw.tail_layer.area_per_molecule_parameter.enabled = True\n",
360360
"\n",
361-
"d70d2o.constain_multiple_contrast(d13d2o)\n",
362-
"d83acmw.constain_multiple_contrast(d70d2o)"
361+
"d70d2o.constrain_multiple_contrast(d13d2o)\n",
362+
"d83acmw.constrain_multiple_contrast(d70d2o)"
363363
]
364364
},
365365
{

docs/src/tutorials/simulation/resolution_functions.ipynb

Lines changed: 64 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"from easyreflectometry.model import Model\n",
4747
"from easyreflectometry.model import LinearSpline\n",
4848
"from easyreflectometry.model import PercentageFwhm\n",
49+
"from easyreflectometry.model import Pointwise\n",
4950
"from easyreflectometry.sample import Layer\n",
5051
"from easyreflectometry.sample import Material\n",
5152
"from easyreflectometry.sample import Multilayer\n",
@@ -115,6 +116,16 @@
115116
"dict_reference['10'] = load(file_path_10)"
116117
]
117118
},
119+
{
120+
"cell_type": "code",
121+
"execution_count": null,
122+
"id": "e5f65ed7",
123+
"metadata": {},
124+
"outputs": [],
125+
"source": [
126+
"dict_reference['0']"
127+
]
128+
},
118129
{
119130
"cell_type": "markdown",
120131
"id": "1ab3a164-62c8-4bd3-b0d8-e6f22c83dc74",
@@ -251,9 +262,15 @@
251262
"id": "defd6dd5-c618-4af6-a5c7-17532207f0a0",
252263
"metadata": {},
253264
"source": [
254-
"## Resolution functions\n",
255-
"\n",
256-
"We now define the different resoultion functions. "
265+
"## Resolution functions "
266+
]
267+
},
268+
{
269+
"cell_type": "markdown",
270+
"id": "c9d903db",
271+
"metadata": {},
272+
"source": [
273+
"We can now define the different resoultion functions. "
257274
]
258275
},
259276
{
@@ -376,11 +393,53 @@
376393
"plt.yscale('log')\n",
377394
"plt.show()"
378395
]
396+
},
397+
{
398+
"cell_type": "code",
399+
"execution_count": null,
400+
"id": "43881642",
401+
"metadata": {},
402+
"outputs": [],
403+
"source": [
404+
"key = '1'\n",
405+
"reference_coords = dict_reference[key]['coords']['Qz_0'].values\n",
406+
"reference_variances = dict_reference[key]['coords']['Qz_0'].variances\n",
407+
"reference_data = dict_reference[key]['data']['R_0'].values\n",
408+
"model_coords = np.linspace(\n",
409+
" start=min(reference_coords),\n",
410+
" stop=max(reference_coords),\n",
411+
" num=1000,\n",
412+
")\n",
413+
"\n",
414+
"model.resolution_function = resolution_function_dict[key]\n",
415+
"model_data = model.interface().reflectity_profile(\n",
416+
" model_coords,\n",
417+
" model.unique_name,\n",
418+
")\n",
419+
"plt.plot(model_coords, model_data, 'k-', label=f'Variable', linewidth=5)\n",
420+
"data_points = []\n",
421+
"data_points.append(reference_coords) # Qz\n",
422+
"data_points.append(reference_data) # R\n",
423+
"data_points.append(reference_variances) # sQz\n",
424+
"model.resolution_function = Pointwise(q_data_points=data_points)\n",
425+
"model_data = model.interface().reflectity_profile(\n",
426+
" model_coords,\n",
427+
" model.unique_name,\n",
428+
")\n",
429+
"plt.plot(model_coords, model_data, 'r-', label=f'Pointwise')\n",
430+
"\n",
431+
"ax = plt.gca()\n",
432+
"ax.set_xlim([-0.01, 0.45])\n",
433+
"ax.set_ylim([1e-10, 2.5])\n",
434+
"plt.legend()\n",
435+
"plt.yscale('log')\n",
436+
"plt.show()"
437+
]
379438
}
380439
],
381440
"metadata": {
382441
"kernelspec": {
383-
"display_name": "easyref",
442+
"display_name": "erl",
384443
"language": "python",
385444
"name": "python3"
386445
},
@@ -394,7 +453,7 @@
394453
"name": "python",
395454
"nbconvert_exporter": "python",
396455
"pygments_lexer": "ipython3",
397-
"version": "3.12.9"
456+
"version": "3.12.10"
398457
}
399458
},
400459
"nbformat": 4,

pyproject.toml

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,41 +21,40 @@ classifiers = [
2121
"Topic :: Scientific/Engineering",
2222
"Programming Language :: Python :: 3",
2323
"Programming Language :: Python :: 3 :: Only",
24-
"Programming Language :: Python :: 3.10",
2524
"Programming Language :: Python :: 3.11",
2625
"Programming Language :: Python :: 3.12",
2726
"Development Status :: 3 - Alpha"
2827
]
2928

30-
requires-python = ">=3.10,<3.13"
29+
requires-python = ">=3.11,<3.13"
3130

3231
dependencies = [
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-
"bumps==1.0.0b7",
32+
"easyscience",
33+
"scipp",
34+
"refnx",
35+
"refl1d>=1.0.0rc0",
36+
"orsopy",
37+
"xhtml2pdf",
38+
"bumps",
4039
]
4140

4241
[project.optional-dependencies]
4342
dev = [
44-
"build==1.2.2.post1",
45-
"codecov==2.1.13",
46-
"coverage==7.7.0",
47-
"coveralls==4.0.1",
48-
"flake8==7.1.2",
49-
"ipykernel==6.29.5",
50-
"jupyter==1.1.1",
51-
"jupyterlab==4.3.6",
52-
"plopp==25.3.0",
53-
"pooch==1.8.2",
54-
"pytest==8.3.5",
55-
"pytest-cov==6.0.0",
56-
"ruff==0.11.0",
57-
"toml==0.10.2",
58-
"yapf==0.43.0",
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",
5958
]
6059

6160
docs = [
@@ -134,10 +133,9 @@ force-single-line = true
134133
legacy_tox_ini = """
135134
[tox]
136135
isolated_build = True
137-
envlist = py{3.10,3.11,3.12}
136+
envlist = py{3.11,3.12}
138137
[gh-actions]
139138
python =
140-
3.10: py310
141139
3.11: py311
142140
3.12: py312
143141
[gh-actions:env]

src/easyreflectometry/calculators/bornagain/calculator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__author__ = 'github.com/arm61'
22

3-
from easyscience.Objects.Inferface import ItemContainer
3+
from easyscience.fitting.calculators.interface_factory import ItemContainer
44

55
from easyreflectometry.model import Model
66
from easyreflectometry.sample import Layer

src/easyreflectometry/calculators/calculator_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from typing import Callable
55

66
import numpy as np
7-
from easyscience.Objects.core import ComponentSerializer
8-
from easyscience.Objects.Inferface import ItemContainer
7+
from easyscience.fitting.calculators.interface_factory import ItemContainer
8+
from easyscience.io import SerializerComponent
99

1010
from easyreflectometry.model import Model
1111
from easyreflectometry.sample import BaseAssembly
@@ -17,7 +17,7 @@
1717
from .wrapper_base import WrapperBase
1818

1919

20-
class CalculatorBase(ComponentSerializer, metaclass=ABCMeta):
20+
class CalculatorBase(SerializerComponent, metaclass=ABCMeta):
2121
"""
2222
This class is a template and defines all properties that a calculator should have.
2323
"""

src/easyreflectometry/calculators/factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__author__ = 'github.com/wardsimon'
22
from typing import Callable
33

4-
from easyscience.Objects.Inferface import InterfaceFactoryTemplate
4+
from easyscience.fitting.calculators.interface_factory import InterfaceFactoryTemplate
55

66
from easyreflectometry.calculators import CalculatorBase
77

0 commit comments

Comments
 (0)