Skip to content

Commit b56f04f

Browse files
authored
Merge pull request #121 from scipp/standard-domain-types
Change domain names to standard scheme
2 parents c7cba13 + c3e547a commit b56f04f

18 files changed

+148
-142
lines changed

docs/odin/odin-data-reduction.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"metadata": {},
6666
"outputs": [],
6767
"source": [
68-
"tmpx3 = wf.compute(DetectorData[SampleRun])\n",
68+
"tmpx3 = wf.compute(RawDetector[SampleRun])\n",
6969
"tmpx3"
7070
]
7171
},
@@ -96,7 +96,7 @@
9696
"metadata": {},
9797
"outputs": [],
9898
"source": [
99-
"wf.visualize(DetectorTofData[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
99+
"wf.visualize(TofDetector[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
100100
]
101101
},
102102
{
@@ -135,7 +135,7 @@
135135
"metadata": {},
136136
"outputs": [],
137137
"source": [
138-
"sample_wavs = wf.compute(CountsWavelength[SampleRun])\n",
138+
"sample_wavs = wf.compute(WavelengthDetector[SampleRun])\n",
139139
"\n",
140140
"sample_wavs.bins.concat().hist(wavelength=300).plot()"
141141
]
@@ -158,7 +158,7 @@
158158
"outputs": [],
159159
"source": [
160160
"wf[Filename[OpenBeamRun]] = odin.data.iron_simulation_ob_small()\n",
161-
"openbeam_wavs = wf.compute(CountsWavelength[OpenBeamRun])\n",
161+
"openbeam_wavs = wf.compute(WavelengthDetector[OpenBeamRun])\n",
162162
"\n",
163163
"openbeam_wavs.bins.concat().hist(wavelength=300).plot()"
164164
]
@@ -213,7 +213,7 @@
213213
"metadata": {},
214214
"outputs": [],
215215
"source": [
216-
"masked = wf.compute(CountsMasked[SampleRun])\n",
216+
"masked = wf.compute(CorrectedDetector[SampleRun])\n",
217217
"\n",
218218
"masked.hist().plot(aspect='equal')"
219219
]
@@ -239,8 +239,8 @@
239239
"wbins = sc.linspace('wavelength', 1.1, 9.4, 301, unit='angstrom')\n",
240240
"\n",
241241
"normalized = (\n",
242-
" wf.compute(CountsMasked[SampleRun]).bins.concat().hist(wavelength=wbins) /\n",
243-
" wf.compute(CountsMasked[OpenBeamRun]).bins.concat().hist(wavelength=wbins)\n",
242+
" wf.compute(CorrectedDetector[SampleRun]).bins.concat().hist(wavelength=wbins) /\n",
243+
" wf.compute(CorrectedDetector[OpenBeamRun]).bins.concat().hist(wavelength=wbins)\n",
244244
")\n",
245245
"\n",
246246
"normalized.plot()"

docs/odin/odin-make-tof-lookup-table.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"source": [
1818
"import scipp as sc\n",
1919
"from ess.reduce import time_of_flight\n",
20+
"from ess.reduce.nexus.types import AnyRun\n",
2021
"from ess.odin.beamline import choppers"
2122
]
2223
},
@@ -39,7 +40,7 @@
3940
"disk_choppers = choppers(source_position)\n",
4041
"\n",
4142
"wf = time_of_flight.TofLookupTableWorkflow()\n",
42-
"wf[time_of_flight.DiskChoppers] = disk_choppers\n",
43+
"wf[time_of_flight.DiskChoppers[AnyRun]] = disk_choppers\n",
4344
"wf[time_of_flight.SourcePosition] = source_position\n",
4445
"wf[time_of_flight.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n",
4546
"wf[time_of_flight.SimulationSeed] = 1234\n",

docs/tbl/tbl-data-reduction.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"source": [
6161
"wf[NeXusDetectorName] = \"ngem_detector\"\n",
6262
"\n",
63-
"wf.visualize(DetectorData[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
63+
"wf.visualize(RawDetector[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
6464
]
6565
},
6666
{
@@ -70,7 +70,7 @@
7070
"metadata": {},
7171
"outputs": [],
7272
"source": [
73-
"ngem = wf.compute(DetectorData[SampleRun])\n",
73+
"ngem = wf.compute(RawDetector[SampleRun])\n",
7474
"ngem"
7575
]
7676
},
@@ -99,7 +99,7 @@
9999
"metadata": {},
100100
"outputs": [],
101101
"source": [
102-
"wf.visualize(DetectorTofData[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
102+
"wf.visualize(TofDetector[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
103103
]
104104
},
105105
{
@@ -136,8 +136,8 @@
136136
"metadata": {},
137137
"outputs": [],
138138
"source": [
139-
"ngem_tofs = wf.compute(DetectorTofData[SampleRun])\n",
140-
"ngem_wavs = wf.compute(CountsWavelength[SampleRun])\n",
139+
"ngem_tofs = wf.compute(TofDetector[SampleRun])\n",
140+
"ngem_wavs = wf.compute(WavelengthDetector[SampleRun])\n",
141141
"\n",
142142
"ngem_tofs.bins.concat().hist(tof=100).plot() + ngem_wavs.bins.concat().hist(wavelength=100).plot()"
143143
]
@@ -162,7 +162,7 @@
162162
"he3 = {}\n",
163163
"for bank in ('he3_detector_bank0', 'he3_detector_bank1'):\n",
164164
" he3_wf[NeXusDetectorName] = bank\n",
165-
" he3[bank] = he3_wf.compute(DetectorData[SampleRun])"
165+
" he3[bank] = he3_wf.compute(RawDetector[SampleRun])"
166166
]
167167
},
168168
{
@@ -197,8 +197,8 @@
197197
"\n",
198198
"for bank in ('he3_detector_bank0', 'he3_detector_bank1'):\n",
199199
" he3_wf[NeXusDetectorName] = bank\n",
200-
" he3_tofs[bank] = he3_wf.compute(DetectorTofData[SampleRun]).bins.concat().hist(tof=100)\n",
201-
" he3_wavs[bank] = he3_wf.compute(CountsWavelength[SampleRun]).bins.concat().hist(wavelength=100)\n",
200+
" he3_tofs[bank] = he3_wf.compute(TofDetector[SampleRun]).bins.concat().hist(tof=100)\n",
201+
" he3_wavs[bank] = he3_wf.compute(WavelengthDetector[SampleRun]).bins.concat().hist(wavelength=100)\n",
202202
"\n",
203203
"pp.plot(he3_tofs) + pp.plot(he3_wavs)"
204204
]

docs/tbl/tbl-make-tof-lookup-table.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"outputs": [],
1717
"source": [
1818
"import scipp as sc\n",
19-
"from ess.reduce import time_of_flight"
19+
"from ess.reduce import time_of_flight\n",
20+
"from ess.reduce.nexus.types import AnyRun"
2021
]
2122
},
2223
{
@@ -37,7 +38,7 @@
3738
"source_position = sc.vector([0, 0, 0], unit='m')\n",
3839
"\n",
3940
"wf = time_of_flight.TofLookupTableWorkflow()\n",
40-
"wf[time_of_flight.DiskChoppers] = {}\n",
41+
"wf[time_of_flight.DiskChoppers[AnyRun]] = {}\n",
4142
"wf[time_of_flight.SourcePosition] = source_position\n",
4243
"wf[time_of_flight.NumberOfSimulatedNeutrons] = 200_000 # Increase this number for more reliable results\n",
4344
"wf[time_of_flight.SimulationSeed] = 1234\n",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dependencies = [
3838
"scippneutron>=24.12.0",
3939
"scippnexus>=23.11.1",
4040
"tifffile>=2024.7.2",
41-
"essreduce>=25.10.0",
41+
"essreduce>=25.11.0",
4242
"scitiff>=25.7",
4343
]
4444

requirements/base.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ scipp>=25.4.0
1010
scippneutron>=24.12.0
1111
scippnexus>=23.11.1
1212
tifffile>=2024.7.2
13-
essreduce>=25.10.0
13+
essreduce>=25.11.0
1414
scitiff>=25.7

requirements/base.txt

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SHA1:753ad79f56410b37320aff70f9bfd2977ec31d52
1+
# SHA1:da99ba40cef426287cd34dd1a2b56aefd0cb24e6
22
#
33
# This file was generated by pip-compile-multi.
44
# To update, run:
@@ -15,7 +15,7 @@ attrs==25.4.0
1515
# referencing
1616
click==8.3.0
1717
# via dask
18-
cloudpickle==3.1.1
18+
cloudpickle==3.1.2
1919
# via dask
2020
comm==0.2.3
2121
# via ipywidgets
@@ -25,31 +25,31 @@ cyclebane==24.10.0
2525
# via sciline
2626
cycler==0.12.1
2727
# via matplotlib
28-
dask==2025.9.1
28+
dask==2025.10.0
2929
# via -r base.in
3030
decorator==5.2.1
3131
# via ipython
3232
dnspython==2.8.0
3333
# via email-validator
3434
email-validator==2.3.0
3535
# via scippneutron
36-
essreduce==25.10.0
36+
essreduce==25.11.0
3737
# via -r base.in
3838
executing==2.2.1
3939
# via stack-data
4040
fonttools==4.60.1
4141
# via matplotlib
42-
fsspec==2025.9.0
42+
fsspec==2025.10.0
4343
# via dask
4444
graphviz==0.21
4545
# via
4646
# -r base.in
4747
# plopp
48-
h5py==3.14.0
48+
h5py==3.15.1
4949
# via
5050
# scippneutron
5151
# scippnexus
52-
idna==3.10
52+
idna==3.11
5353
# via email-validator
5454
importlib-metadata==8.7.0
5555
# via dask
@@ -63,7 +63,7 @@ ipython==9.6.0
6363
# ipywidgets
6464
ipython-pygments-lexers==1.1.1
6565
# via ipython
66-
ipywidgets==8.1.7
66+
ipywidgets==8.1.8
6767
# via
6868
# ipydatawidgets
6969
# ipympl
@@ -75,7 +75,7 @@ jsonschema==4.25.1
7575
# via scitiff
7676
jsonschema-specifications==2025.9.1
7777
# via jsonschema
78-
jupyterlab-widgets==3.0.15
78+
jupyterlab-widgets==3.0.16
7979
# via ipywidgets
8080
kiwisolver==1.4.9
8181
# via matplotlib
@@ -90,15 +90,15 @@ matplotlib==3.10.7
9090
# ipympl
9191
# mpltoolbox
9292
# plopp
93-
matplotlib-inline==0.1.7
93+
matplotlib-inline==0.2.1
9494
# via ipython
95-
mpltoolbox==25.5.0
95+
mpltoolbox==25.10.0
9696
# via
9797
# plopp
9898
# scippneutron
9999
networkx==3.5
100100
# via cyclebane
101-
numpy==2.3.3
101+
numpy==2.3.4
102102
# via
103103
# contourpy
104104
# h5py
@@ -121,7 +121,7 @@ partd==1.4.2
121121
# via dask
122122
pexpect==4.9.0
123123
# via ipython
124-
pillow==11.3.0
124+
pillow==12.0.0
125125
# via
126126
# ipympl
127127
# matplotlib
@@ -135,11 +135,11 @@ ptyprocess==0.7.0
135135
# via pexpect
136136
pure-eval==0.2.3
137137
# via stack-data
138-
pydantic==2.12.0
138+
pydantic==2.12.3
139139
# via
140140
# scippneutron
141141
# scitiff
142-
pydantic-core==2.41.1
142+
pydantic-core==2.41.4
143143
# via pydantic
144144
pygments==2.19.2
145145
# via
@@ -156,15 +156,15 @@ pythreejs==2.4.2
156156
# via plopp
157157
pyyaml==6.0.3
158158
# via dask
159-
referencing==0.36.2
159+
referencing==0.37.0
160160
# via
161161
# jsonschema
162162
# jsonschema-specifications
163-
rpds-py==0.27.1
163+
rpds-py==0.28.0
164164
# via
165165
# jsonschema
166166
# referencing
167-
sciline==25.8.0
167+
sciline==25.11.1
168168
# via
169169
# -r base.in
170170
# essreduce
@@ -185,7 +185,7 @@ scippnexus==25.6.0
185185
# -r base.in
186186
# essreduce
187187
# scippneutron
188-
scipy==1.16.2
188+
scipy==1.16.3
189189
# via
190190
# scippneutron
191191
# scippnexus
@@ -195,11 +195,11 @@ six==1.17.0
195195
# via python-dateutil
196196
stack-data==0.6.3
197197
# via ipython
198-
tifffile==2025.10.4
198+
tifffile==2025.10.16
199199
# via
200200
# -r base.in
201201
# scitiff
202-
toolz==1.0.0
202+
toolz==1.1.0
203203
# via
204204
# dask
205205
# partd
@@ -211,21 +211,20 @@ traitlets==5.14.3
211211
# matplotlib-inline
212212
# pythreejs
213213
# traittypes
214-
traittypes==0.2.1
214+
traittypes==0.2.3
215215
# via ipydatawidgets
216216
typing-extensions==4.15.0
217217
# via
218218
# ipython
219219
# pydantic
220220
# pydantic-core
221221
# referencing
222-
# sciline
223222
# typing-inspection
224223
typing-inspection==0.4.2
225224
# via pydantic
226225
wcwidth==0.2.14
227226
# via prompt-toolkit
228-
widgetsnbextension==4.0.14
227+
widgetsnbextension==4.0.15
229228
# via ipywidgets
230229
zipp==3.23.0
231230
# via importlib-metadata

0 commit comments

Comments
 (0)