Skip to content

Commit 9cddb98

Browse files
authored
New easycore (#257)
* initial commit * fixed unit tests * updated smearing * fix unit tests * updated/fixed pointwise impl * fix method name * datasets now have proper names, instead of `R_0` and `Qz_0`. * added color changer, renamed default model, minor fixes * added experiment index * added tests * fix issue with multiple experiments and a single model * added a helper method * initial version. Much to be done * some more conversions * constraint fixes * proper module name * added state variable * skip a trouble test * update python versioning * case_fixes have been merged to develop * update dependencies. Unpin everything but refl1d
1 parent 747e2ad commit 9cddb98

Some content is hidden

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

53 files changed

+250
-354
lines changed

.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

pyproject.toml

Lines changed: 23 additions & 25 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",
32+
"easyscience",
33+
"scipp",
34+
"refnx",
3635
"refl1d[webview]==1.0.0a12",
37-
"orsopy==1.2.1",
38-
"xhtml2pdf==0.2.17",
39-
"bumps==1.0.0b7",
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

src/easyreflectometry/calculators/refl1d/wrapper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ def create_item(self, name: str):
4242
4343
:param name: The name of the item
4444
"""
45-
self.storage['item'][name] = Repeat(
46-
names.Stack(names.Slab(names.SLD(), thickness=0, interface=0)), name=str(name)
47-
)
45+
self.storage['item'][name] = Repeat(names.Stack(names.Slab(names.SLD(), thickness=0, interface=0)), name=str(name))
4846
del self.storage['item'][name].stack[0]
4947

5048
def update_layer(self, name: str, **kwargs):
@@ -66,7 +64,9 @@ def get_layer_value(self, name: str, key: str) -> float:
6664
:param key: The given value keys
6765
"""
6866
if key in ['magnetism_rhoM', 'magnetism_thetaM']:
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
67+
return getattr(
68+
self.storage['layer'][name].magnetism, key.split('_')[-1]
69+
).value # TODO: check if we want to return the raw value or the full Parameter # noqa: E501
7070
return super().get_layer_value(name, key)
7171

7272
def create_model(self, name: str):

src/easyreflectometry/data/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from .measurement import merge_datagroups
66

77
__all__ = [
8-
"load",
9-
"load_as_dataset",
10-
"merge_datagroups",
11-
"ProjectData",
12-
"DataSet1D",
8+
'load',
9+
'load_as_dataset',
10+
'merge_datagroups',
11+
'ProjectData',
12+
'DataSet1D',
1313
]

0 commit comments

Comments
 (0)