Skip to content

Commit 055df69

Browse files
authored
Merge pull request #181 from scipp/standard-domain-types
Change domain names to standard scheme
2 parents c547fa6 + 3b088a1 commit 055df69

File tree

19 files changed

+65
-43
lines changed

19 files changed

+65
-43
lines changed

docs/user-guide/offspec/offspec_reduction.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@
113113
"header.data_source.measurement = fileio.data_source.Measurement(\n",
114114
" instrument_settings=fileio.data_source.InstrumentSettings(\n",
115115
" incident_angle=fileio.base.Value(\n",
116-
" wf.compute(DetectorData[SampleRun]).coords[\"theta\"].value,\n",
117-
" wf.compute(DetectorData[SampleRun]).coords[\"theta\"].unit\n",
116+
" wf.compute(RawDetector[SampleRun]).coords[\"theta\"].value,\n",
117+
" wf.compute(RawDetector[SampleRun]).coords[\"theta\"].unit\n",
118118
" ),\n",
119119
" wavelength=None,\n",
120120
" polarization=\"unpolarized\",\n",
@@ -183,8 +183,8 @@
183183
"metadata": {},
184184
"outputs": [],
185185
"source": [
186-
"wf.compute(DetectorData[SampleRun]).hist(tof=50).plot(norm='log') \\\n",
187-
"+ wf.compute(DetectorData[ReferenceRun]).hist(tof=50).plot(norm='log')"
186+
"wf.compute(RawDetector[SampleRun]).hist(tof=50).plot(norm='log') \\\n",
187+
"+ wf.compute(RawDetector[ReferenceRun]).hist(tof=50).plot(norm='log')"
188188
]
189189
},
190190
{

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies = [
3939
"scipp>=24.09.1", # Fixed new hist/bin API
4040
"scippneutron>=24.10.0",
4141
"scippnexus>=24.9.1",
42-
"essreduce>=25.10.2",
42+
"essreduce>=25.11.0",
4343
"pandas>=2.1.2",
4444
]
4545

requirements/base.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ sciline>=24.6.0
1111
scipp>=24.09.1
1212
scippneutron>=24.10.0
1313
scippnexus>=24.9.1
14-
essreduce>=25.10.2
14+
essreduce>=25.11.0
1515
pandas>=2.1.2

requirements/base.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SHA1:8d6f6741be43a1856d2a52aa2ce05d8e8110ee30
1+
# SHA1:ac5d5ed5d7ed7425eb3b92f0cfa128fe6db146b4
22
#
33
# This file was generated by pip-compile-multi.
44
# To update, run:
@@ -9,7 +9,7 @@ annotated-types==0.7.0
99
# via pydantic
1010
click==8.3.0
1111
# via dask
12-
cloudpickle==3.1.1
12+
cloudpickle==3.1.2
1313
# via dask
1414
contourpy==1.3.3
1515
# via matplotlib
@@ -23,7 +23,7 @@ dnspython==2.8.0
2323
# via email-validator
2424
email-validator==2.3.0
2525
# via scippneutron
26-
essreduce==25.10.2
26+
essreduce==25.11.0
2727
# via -r base.in
2828
fonttools==4.60.1
2929
# via matplotlib
@@ -100,7 +100,7 @@ pyyaml==6.0.3
100100
# via
101101
# dask
102102
# orsopy
103-
sciline==25.8.0
103+
sciline==25.11.1
104104
# via
105105
# -r base.in
106106
# essreduce
@@ -133,7 +133,6 @@ typing-extensions==4.15.0
133133
# via
134134
# pydantic
135135
# pydantic-core
136-
# sciline
137136
# typing-inspection
138137
typing-inspection==0.4.2
139138
# via pydantic

requirements/nightly.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dask>=2022.1.0
55
python-dateutil
66
graphviz
77
orsopy>=1.2
8-
essreduce>=25.10.2
8+
essreduce>=25.11.0
99
pandas>=2.1.2
1010
pytest>=7.0
1111
pooch>=1.5

requirements/nightly.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SHA1:bc4cf516bc2a50b9d42c8baa03b95ea4d7e54a3d
1+
# SHA1:1e183c3e9d303722f2579385b8d7861f9200b810
22
#
33
# This file was generated by pip-compile-multi.
44
# To update, run:
@@ -16,7 +16,7 @@ charset-normalizer==3.4.4
1616
# via requests
1717
click==8.3.0
1818
# via dask
19-
cloudpickle==3.1.1
19+
cloudpickle==3.1.2
2020
# via dask
2121
contourpy==1.3.3
2222
# via matplotlib
@@ -30,7 +30,7 @@ dnspython==2.8.0
3030
# via email-validator
3131
email-validator==2.3.0
3232
# via scippneutron
33-
essreduce==25.10.2
33+
essreduce==25.11.0
3434
# via -r nightly.in
3535
fonttools==4.60.1
3636
# via matplotlib
@@ -157,7 +157,6 @@ typing-extensions==4.15.0
157157
# via
158158
# pydantic
159159
# pydantic-core
160-
# sciline
161160
# typing-inspection
162161
typing-inspection==0.4.2
163162
# via pydantic

src/ess/amor/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
DetectorSpatialResolution,
1515
NeXusDetectorName,
1616
Position,
17+
ReferenceRun,
1718
RunType,
1819
SampleRotationOffset,
20+
SampleRun,
1921
)
2022
from . import (
2123
conversions,
@@ -81,7 +83,11 @@ def AmorWorkflow() -> sciline.Pipeline:
8183
"""
8284
Workflow with default parameters for the Amor PSI instrument.
8385
"""
84-
return sciline.Pipeline(providers=providers, params=default_parameters())
86+
return sciline.Pipeline(
87+
providers=providers,
88+
params=default_parameters(),
89+
constraints={RunType: [SampleRun, ReferenceRun]},
90+
)
8591

8692

8793
__all__ = [

src/ess/amor/load.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
from ..reflectometry.types import (
1111
Beamline,
1212
BeamSize,
13-
DetectorData,
1413
DetectorRotation,
1514
Filename,
1615
Measurement,
1716
NeXusComponent,
1817
NeXusDetectorName,
1918
ProtonCurrent,
2019
RawChopper,
20+
RawDetector,
2121
RawSampleRotation,
2222
RunType,
2323
SampleRotation,
@@ -49,7 +49,7 @@ def load_events(
4949
chopper_separation: ChopperSeparation[RunType],
5050
sample_size: SampleSize[RunType],
5151
beam_size: BeamSize[RunType],
52-
) -> DetectorData[RunType]:
52+
) -> RawDetector[RunType]:
5353
event_data = detector["data"]
5454
if 'event_time_zero' in event_data.coords:
5555
event_data.bins.coords['event_time_zero'] = sc.bins_like(
@@ -77,7 +77,7 @@ def load_events(
7777
data.coords["chopper_distance"] = chopper_distance
7878
data.coords["sample_size"] = sample_size
7979
data.coords["beam_size"] = beam_size
80-
return DetectorData[RunType](data)
80+
return RawDetector[RunType](data)
8181

8282

8383
def amor_chopper(f: Filename[RunType]) -> RawChopper[RunType]:
@@ -133,13 +133,13 @@ def load_amor_proton_current(
133133
return pc
134134

135135

136-
def load_beamline_metadata(filename: Filename[SampleRun]) -> Beamline:
136+
def load_beamline_metadata(filename: Filename[RunType]) -> Beamline[RunType]:
137137
return nexus_workflow.load_beamline_metadata_from_nexus(
138138
NeXusFileSpec[SampleRun](filename)
139139
)
140140

141141

142-
def load_measurement_metadata(filename: Filename[SampleRun]) -> Measurement:
142+
def load_measurement_metadata(filename: Filename[RunType]) -> Measurement[RunType]:
143143
return nexus_workflow.load_measurement_metadata_from_nexus(
144144
NeXusFileSpec[SampleRun](filename)
145145
)

src/ess/amor/workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from ..reflectometry.types import (
99
BeamDivergenceLimits,
1010
CoordTransformationGraph,
11-
DetectorData,
1211
ProtonCurrent,
12+
RawDetector,
1313
ReducibleData,
1414
RunType,
1515
WavelengthBins,
@@ -20,7 +20,7 @@
2020

2121

2222
def add_coords_masks_and_apply_corrections(
23-
da: DetectorData[RunType],
23+
da: RawDetector[RunType],
2424
ylim: YIndexLimits,
2525
zlims: ZIndexLimits,
2626
bdlim: BeamDivergenceLimits,

src/ess/estia/corrections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from ..reflectometry.types import (
1212
BeamDivergenceLimits,
1313
CoordTransformationGraph,
14-
DetectorData,
1514
ProtonCurrent,
15+
RawDetector,
1616
ReducibleData,
1717
RunType,
1818
WavelengthBins,
@@ -23,7 +23,7 @@
2323

2424

2525
def add_coords_masks_and_apply_corrections(
26-
da: DetectorData[RunType],
26+
da: RawDetector[RunType],
2727
ylim: YIndexLimits,
2828
zlims: ZIndexLimits,
2929
bdlim: BeamDivergenceLimits,

0 commit comments

Comments
 (0)