Skip to content

Commit 88b9e08

Browse files
authored
Merge pull request #40 from scipp/guideline-adherence
Guideline adherence
2 parents ac77b12 + f62978d commit 88b9e08

File tree

25 files changed

+291
-331
lines changed

25 files changed

+291
-331
lines changed

conda/meta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ requirements:
2020
- sciline>=23.9.1
2121
- scipp>=23.8.0
2222
- scippneutron>=23.9.0
23+
- essreduce
2324
- python>=3.10
2425

2526
test:

docs/examples/amor.ipynb

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"import scipp as sc\n",
2121
"import sciline\n",
2222
"from essreflectometry.amor import providers, default_parameters\n",
23-
"from essreflectometry.types import *"
23+
"from essreflectometry.types import *\n",
24+
"from essreflectometry.amor.data import providers as amor_data"
2425
]
2526
},
2627
{
@@ -29,27 +30,17 @@
2930
"metadata": {},
3031
"outputs": [],
3132
"source": [
32-
"params = {\n",
33-
" **default_parameters,\n",
34-
" QBins: sc.geomspace(dim='Q', start=0.008, stop=0.075, num=200, unit='1/angstrom'),\n",
35-
" SampleRotation[Sample]: sc.scalar(0.7989, unit='deg'),\n",
36-
" Filename[Sample]: \"sample.nxs\",\n",
37-
" SampleRotation[Reference]: sc.scalar(0.8389, unit='deg'),\n",
38-
" Filename[Reference]: \"reference.nxs\",\n",
39-
" WavelengthEdges: sc.array(dims=['wavelength'], values=[2.4, 16.0], unit='angstrom'),\n",
40-
"}"
41-
]
42-
},
43-
{
44-
"cell_type": "code",
45-
"execution_count": null,
46-
"metadata": {},
47-
"outputs": [],
48-
"source": [
49-
"pipeline = sciline.Pipeline(\n",
50-
" providers,\n",
51-
" params=params\n",
52-
")"
33+
"pl = sciline.Pipeline(\n",
34+
" (*providers, *amor_data),\n",
35+
" params=default_parameters\n",
36+
")\n",
37+
"\n",
38+
"pl[QBins] = sc.geomspace(dim='Q', start=0.008, stop=0.075, num=200, unit='1/angstrom')\n",
39+
"pl[SampleRotation[Sample]] = sc.scalar(0.7989, unit='deg')\n",
40+
"pl[PoochFilename[Sample]] = \"sample.nxs\"\n",
41+
"pl[SampleRotation[Reference]] = sc.scalar(0.8389, unit='deg')\n",
42+
"pl[PoochFilename[Reference]] = \"reference.nxs\"\n",
43+
"pl[WavelengthEdges] = sc.array(dims=['wavelength'], values=[2.4, 16.0], unit='angstrom')"
5344
]
5445
},
5546
{
@@ -58,7 +49,7 @@
5849
"metadata": {},
5950
"outputs": [],
6051
"source": [
61-
"pipeline.visualize((NormalizedIofQ, QResolution), graph_attr={'rankdir': 'LR'})"
52+
"pl.visualize((NormalizedIofQ, QResolution), graph_attr={'rankdir': 'LR'})"
6253
]
6354
},
6455
{
@@ -68,7 +59,7 @@
6859
"outputs": [],
6960
"source": [
7061
"# Compute I over Q and the standard deviation of Q\n",
71-
"ioq, qstd = pipeline.compute((NormalizedIofQ, QResolution)).values()"
62+
"ioq, qstd = pl.compute((NormalizedIofQ, QResolution)).values()"
7263
]
7364
},
7465
{
@@ -103,7 +94,7 @@
10394
"outputs": [],
10495
"source": [
10596
"from essreflectometry.types import ThetaData\n",
106-
"pipeline.compute(ThetaData[Sample])\\\n",
97+
"pl.compute(ThetaData[Sample])\\\n",
10798
" .bins.concat('detector_number')\\\n",
10899
" .hist(\n",
109100
" theta=sc.linspace(dim='theta', start=0.0, stop=1.2, num=165, unit='deg').to(unit='rad'),\n",
@@ -149,22 +140,14 @@
149140
"metadata": {},
150141
"outputs": [],
151142
"source": [
152-
"providers_with_metadata = (\n",
153-
" *providers,\n",
154-
" *orso.providers,\n",
155-
" *amor_orso.providers,\n",
156-
")\n",
143+
"for p in (*orso.providers, *amor_orso.providers):\n",
144+
" pl.insert(p)\n",
157145
"\n",
158-
"params[orso.OrsoCreator] = orso.OrsoCreator(fileio.base.Person(\n",
146+
"pl[orso.OrsoCreator] = orso.OrsoCreator(fileio.base.Person(\n",
159147
" name='Max Mustermann',\n",
160148
" affiliation='European Spallation Source ERIC',\n",
161149
" contact='[email protected]',\n",
162-
"))\n",
163-
"\n",
164-
"metadata_pipeline = sciline.Pipeline(\n",
165-
" providers_with_metadata,\n",
166-
" params=params\n",
167-
")"
150+
"))"
168151
]
169152
},
170153
{
@@ -180,7 +163,7 @@
180163
"metadata": {},
181164
"outputs": [],
182165
"source": [
183-
"iofq_dataset = metadata_pipeline.compute(orso.OrsoIofQDataset)"
166+
"iofq_dataset = pl.compute(orso.OrsoIofQDataset)"
184167
]
185168
},
186169
{
@@ -243,7 +226,7 @@
243226
"metadata": {},
244227
"outputs": [],
245228
"source": [
246-
"iofq_dataset.info.reduction.corrections = orso.find_corrections(metadata_pipeline.get(orso.OrsoIofQDataset))"
229+
"iofq_dataset.info.reduction.corrections = orso.find_corrections(pl.get(orso.OrsoIofQDataset))"
247230
]
248231
},
249232
{

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dependencies = [
3939
"sciline>=23.9.1",
4040
"scipp>=23.8.0",
4141
"scippneutron>=23.9.0",
42+
"essreduce",
4243
]
4344

4445
dynamic = ["version"]

requirements/base.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ orsopy
1111
sciline>=23.9.1
1212
scipp>=23.8.0
1313
scippneutron>=23.9.0
14+
essreduce

requirements/base.txt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SHA1:697621007a6df52e05884bd9bf630052e4aa6fbe
1+
# SHA1:1b431955cc8f1e9144b3b02f13d86b0693935140
22
#
33
# This file is autogenerated by pip-compile-multi
44
# To update, run:
@@ -15,16 +15,18 @@ click==8.1.7
1515
# via dask
1616
cloudpickle==3.0.0
1717
# via dask
18-
comm==0.2.1
18+
comm==0.2.2
1919
# via ipywidgets
2020
contourpy==1.2.0
2121
# via matplotlib
2222
cycler==0.12.1
2323
# via matplotlib
24-
dask==2024.2.0
24+
dask==2024.3.0
2525
# via -r base.in
2626
decorator==5.1.1
2727
# via ipython
28+
essreduce==24.3.11
29+
# via -r base.in
2830
exceptiongroup==1.2.0
2931
# via ipython
3032
executing==2.0.1
@@ -41,11 +43,11 @@ h5py==3.10.0
4143
# scippnexus
4244
idna==3.6
4345
# via requests
44-
importlib-metadata==7.0.1
46+
importlib-metadata==7.0.2
4547
# via dask
4648
ipydatawidgets==4.3.5
4749
# via pythreejs
48-
ipython==8.22.1
50+
ipython==8.22.2
4951
# via ipywidgets
5052
ipywidgets==8.1.2
5153
# via
@@ -73,9 +75,9 @@ numpy==1.26.4
7375
# scipp
7476
# scippneutron
7577
# scipy
76-
orsopy==1.1.0
78+
orsopy==1.2.0
7779
# via -r base.in
78-
packaging==23.2
80+
packaging==24.0
7981
# via
8082
# dask
8183
# matplotlib
@@ -102,9 +104,9 @@ pure-eval==0.2.2
102104
# via stack-data
103105
pygments==2.17.2
104106
# via ipython
105-
pyparsing==3.1.1
107+
pyparsing==3.1.2
106108
# via matplotlib
107-
python-dateutil==2.8.2
109+
python-dateutil==2.9.0.post0
108110
# via
109111
# -r base.in
110112
# matplotlib
@@ -122,12 +124,15 @@ sciline==24.2.1
122124
scipp==24.2.0
123125
# via
124126
# -r base.in
127+
# essreduce
125128
# scippneutron
126129
# scippnexus
127130
scippneutron==24.1.0
128131
# via -r base.in
129-
scippnexus==23.12.1
130-
# via scippneutron
132+
scippnexus==24.3.1
133+
# via
134+
# essreduce
135+
# scippneutron
131136
scipy==1.12.0
132137
# via
133138
# scippneutron
@@ -142,7 +147,7 @@ toolz==0.12.1
142147
# via
143148
# dask
144149
# partd
145-
traitlets==5.14.1
150+
traitlets==5.14.2
146151
# via
147152
# comm
148153
# ipython
@@ -158,5 +163,5 @@ wcwidth==0.2.13
158163
# via prompt-toolkit
159164
widgetsnbextension==4.0.10
160165
# via ipywidgets
161-
zipp==3.17.0
166+
zipp==3.18.0
162167
# via importlib-metadata

requirements/basetest.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ exceptiongroup==1.2.0
99
# via pytest
1010
iniconfig==2.0.0
1111
# via pytest
12-
packaging==23.2
12+
packaging==24.0
1313
# via pytest
1414
pluggy==1.4.0
1515
# via pytest
16-
pytest==8.0.1
16+
pytest==8.1.1
1717
# via -r basetest.in
1818
tomli==2.0.1
1919
# via pytest

requirements/ci.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66
# pip-compile-multi
77
#
8-
cachetools==5.3.2
8+
cachetools==5.3.3
99
# via tox
1010
certifi==2024.2.2
1111
# via requests
@@ -27,7 +27,7 @@ gitpython==3.1.42
2727
# via -r ci.in
2828
idna==3.6
2929
# via requests
30-
packaging==23.2
30+
packaging==24.0
3131
# via
3232
# -r ci.in
3333
# pyproject-api
@@ -48,7 +48,7 @@ tomli==2.0.1
4848
# via
4949
# pyproject-api
5050
# tox
51-
tox==4.13.0
51+
tox==4.14.1
5252
# via -r ci.in
5353
urllib3==2.2.1
5454
# via requests

requirements/dev.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ isoduration==20.11.0
4646
# via jsonschema
4747
jinja2-ansible-filters==1.3.2
4848
# via copier
49-
json5==0.9.17
49+
json5==0.9.22
5050
# via jupyterlab-server
5151
jsonpointer==2.4
5252
# via jsonschema
@@ -55,21 +55,21 @@ jsonschema[format-nongpl]==4.21.1
5555
# jupyter-events
5656
# jupyterlab-server
5757
# nbformat
58-
jupyter-events==0.9.0
58+
jupyter-events==0.9.1
5959
# via jupyter-server
60-
jupyter-lsp==2.2.2
60+
jupyter-lsp==2.2.4
6161
# via jupyterlab
62-
jupyter-server==2.12.5
62+
jupyter-server==2.13.0
6363
# via
6464
# jupyter-lsp
6565
# jupyterlab
6666
# jupyterlab-server
6767
# notebook-shim
68-
jupyter-server-terminals==0.5.2
68+
jupyter-server-terminals==0.5.3
6969
# via jupyter-server
70-
jupyterlab==4.1.2
70+
jupyterlab==4.1.4
7171
# via -r dev.in
72-
jupyterlab-server==2.25.3
72+
jupyterlab-server==2.25.4
7373
# via jupyterlab
7474
notebook-shim==0.2.4
7575
# via jupyterlab
@@ -79,17 +79,17 @@ pathspec==0.12.1
7979
# via copier
8080
pip-compile-multi==2.6.3
8181
# via -r dev.in
82-
pip-tools==7.4.0
82+
pip-tools==7.4.1
8383
# via pip-compile-multi
8484
plumbum==1.8.2
8585
# via copier
8686
prometheus-client==0.20.0
8787
# via jupyter-server
8888
pycparser==2.21
8989
# via cffi
90-
pydantic==2.6.1
90+
pydantic==2.6.4
9191
# via copier
92-
pydantic-core==2.16.2
92+
pydantic-core==2.16.3
9393
# via pydantic
9494
python-json-logger==2.0.7
9595
# via jupyter-events
@@ -107,25 +107,25 @@ rfc3986-validator==0.1.1
107107
# jupyter-events
108108
send2trash==1.8.2
109109
# via jupyter-server
110-
sniffio==1.3.0
110+
sniffio==1.3.1
111111
# via
112112
# anyio
113113
# httpx
114-
terminado==0.18.0
114+
terminado==0.18.1
115115
# via
116116
# jupyter-server
117117
# jupyter-server-terminals
118118
toposort==1.10
119119
# via pip-compile-multi
120-
types-python-dateutil==2.8.19.20240106
120+
types-python-dateutil==2.8.19.20240311
121121
# via arrow
122122
uri-template==1.3.0
123123
# via jsonschema
124124
webcolors==1.13
125125
# via jsonschema
126126
websocket-client==1.7.0
127127
# via jupyter-server
128-
wheel==0.42.0
128+
wheel==0.43.0
129129
# via pip-tools
130130

131131
# The following packages are considered to be unsafe in a requirements file:

0 commit comments

Comments
 (0)