Skip to content

Commit

Permalink
Merge pull request #139 from scipp/fix-strange-data-name
Browse files Browse the repository at this point in the history
Fix strange data name
  • Loading branch information
SimonHeybrock authored May 23, 2024
2 parents b0bd3c5 + 8151024 commit e9d0d5e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/ess/isissans/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import scipp as sc

from ..sans.types import (
ConfiguredReducibleDataData,
ConfiguredReducibleData,
ConfiguredReducibleMonitor,
MonitorType,
RawData,
Expand All @@ -28,7 +28,7 @@ def apply_component_user_offsets_to_raw_data(
data: RawData[ScatteringRunType],
sample_offset: SampleOffset,
detector_bank_offset: DetectorBankOffset,
) -> ConfiguredReducibleDataData[ScatteringRunType]:
) -> ConfiguredReducibleData[ScatteringRunType]:
"""Apply user offsets to raw data.
Parameters
Expand All @@ -47,7 +47,7 @@ def apply_component_user_offsets_to_raw_data(
)
pos = data.coords['position']
data.coords['position'] = pos + detector_bank_offset.to(unit=pos.unit, copy=False)
return ConfiguredReducibleDataData[ScatteringRunType](data)
return ConfiguredReducibleData[ScatteringRunType](data)


def apply_component_user_offsets_to_raw_monitor(
Expand Down
4 changes: 2 additions & 2 deletions src/ess/isissans/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import scipp as sc

from ..sans.types import (
ConfiguredReducibleDataData,
ConfiguredReducibleData,
ConfiguredReducibleMonitor,
CorrectForGravity,
DetectorPixelShape,
Expand Down Expand Up @@ -56,7 +56,7 @@ def get_monitor_data(


def data_to_tof(
da: ConfiguredReducibleDataData[ScatteringRunType],
da: ConfiguredReducibleData[ScatteringRunType],
) -> TofData[ScatteringRunType]:
"""Dummy conversion of data to time-of-flight data.
The data already has a time-of-flight coordinate."""
Expand Down
8 changes: 4 additions & 4 deletions src/ess/loki/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from ..sans.common import gravity_vector
from ..sans.types import (
ConfiguredReducibleDataData,
ConfiguredReducibleData,
ConfiguredReducibleMonitor,
CorrectForGravity,
DetectorPixelShape,
Expand Down Expand Up @@ -139,8 +139,8 @@ def patch_detector_data(
detector_data: RawData[ScatteringRunType],
source_position: SourcePosition[ScatteringRunType],
sample_position: SamplePosition[ScatteringRunType],
) -> ConfiguredReducibleDataData[ScatteringRunType]:
return ConfiguredReducibleDataData[ScatteringRunType](
) -> ConfiguredReducibleData[ScatteringRunType]:
return ConfiguredReducibleData[ScatteringRunType](
_add_variances_and_coordinates(
da=detector_data,
source_position=source_position,
Expand All @@ -166,7 +166,7 @@ def _convert_to_tof(da: sc.DataArray) -> sc.DataArray:


def data_to_tof(
da: ConfiguredReducibleDataData[ScatteringRunType],
da: ConfiguredReducibleData[ScatteringRunType],
) -> TofData[ScatteringRunType]:
return TofData[ScatteringRunType](_convert_to_tof(da))

Expand Down
2 changes: 1 addition & 1 deletion src/ess/sans/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class RawData(sciline.Scope[ScatteringRunType, sc.DataArray], sc.DataArray):
"""Raw detector data"""


class ConfiguredReducibleDataData(
class ConfiguredReducibleData(
sciline.Scope[ScatteringRunType, sc.DataArray], sc.DataArray
):
"""Raw event data where variances and necessary coordinates
Expand Down

0 comments on commit e9d0d5e

Please sign in to comment.