Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ess/reduce/nexus/generic_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
"""
SampleRun = NewType('SampleRun', int)
"""Sample run."""
VanadiumRun = NewType('VanadiumRun', int)
"""Vanadium run."""

ScatteringRunType = TypeVar(
'ScatteringRunType',
SampleRun,
BackgroundRun,
SampleRun,
VanadiumRun,
)


Expand All @@ -48,6 +51,7 @@ class TransmissionRun(Generic[ScatteringRunType]):
# Note that mypy does not seem to like this nesting, may need to find a workaround
TransmissionRun[SampleRun],
TransmissionRun[BackgroundRun],
VanadiumRun,
)
"""TypeVar used for specifying BackgroundRun, EmptyBeamRun or SampleRun"""

Expand Down
4 changes: 2 additions & 2 deletions src/ess/reduce/nexus/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def get_calibrated_detector(
# the detector array from the raw loader NeXus group, to prevent a source of bugs.
return AnyRunCalibratedDetector(
da.assign_coords(
position=da.coords['position'] + offset,
position=da.coords['position'] + offset.to(unit=da.coords['position'].unit),
source_position=source_position,
sample_position=sample_position,
gravity=gravity,
Expand Down Expand Up @@ -389,7 +389,7 @@ def get_calibrated_monitor(
"""
return AnyRunAnyCalibratedMonitor(
nexus.extract_monitor_data(monitor).assign_coords(
position=monitor['position'] + offset,
position=monitor['position'] + offset.to(unit=monitor['position'].unit),
source_position=source_position,
)
)
Expand Down