From c747dfc123a91840e80faded294ff86b8d52449d Mon Sep 17 00:00:00 2001 From: Simon Heybrock Date: Mon, 26 Aug 2024 14:01:37 +0200 Subject: [PATCH] Remove some duplicate or unused types --- src/ess/powder/types.py | 8 -------- src/ess/snspowder/powgen/beamline.py | 6 +++--- src/ess/snspowder/powgen/data.py | 8 ++++---- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/ess/powder/types.py b/src/ess/powder/types.py index bc7a8ec2..0a6d794e 100644 --- a/src/ess/powder/types.py +++ b/src/ess/powder/types.py @@ -97,18 +97,10 @@ class DataWithScatteringCoordinates(sciline.Scope[RunType, sc.DataArray], sc.Dat d-spacing.""" -NeXusDetectorDimensions = NewType("NeXusDetectorDimensions", dict[str, int]) -"""Logical detector dimensions.""" - - class DspacingData(sciline.Scope[RunType, sc.DataArray], sc.DataArray): """Data converted to d-spacing.""" -class DspacingDataWithoutVariances(sciline.Scope[RunType, sc.DataArray], sc.DataArray): - """Data converted to d-spacing where variances where removed.""" - - DspacingHistogram = NewType("DspacingHistogram", sc.DataArray) """Histogrammed intensity vs d-spacing.""" diff --git a/src/ess/snspowder/powgen/beamline.py b/src/ess/snspowder/powgen/beamline.py index 2b30ade9..fa89f57e 100644 --- a/src/ess/snspowder/powgen/beamline.py +++ b/src/ess/snspowder/powgen/beamline.py @@ -7,7 +7,7 @@ import scipp as sc from ...powder.types import ( - NeXusDetectorDimensions, + DetectorBankSizes, NeXusDetectorName, ) @@ -55,9 +55,9 @@ def map_detector_to_spectrum( def powgen_detector_dimensions( detector_name: NeXusDetectorName, -) -> NeXusDetectorDimensions: +) -> DetectorBankSizes: """Dimensions used by POWGEN detectors.""" - return NeXusDetectorDimensions(DETECTOR_BANK_SIZES[detector_name]) + return DetectorBankSizes(DETECTOR_BANK_SIZES[detector_name]) providers = (powgen_detector_dimensions,) diff --git a/src/ess/snspowder/powgen/data.py b/src/ess/snspowder/powgen/data.py index ac4c9e28..6ba18112 100644 --- a/src/ess/snspowder/powgen/data.py +++ b/src/ess/snspowder/powgen/data.py @@ -5,13 +5,13 @@ import scipp as sc -from ...powder.types import ( +from ess.powder.types import ( AccumulatedProtonCharge, CalibrationData, CalibrationFilename, + DetectorBankSizes, DetectorData, Filename, - NeXusDetectorDimensions, ProtonCharge, RawDataAndMetadata, RunType, @@ -103,7 +103,7 @@ def pooch_load(filename: Filename[RunType]) -> RawDataAndMetadata[RunType]: def pooch_load_calibration( filename: CalibrationFilename, - detector_dimensions: NeXusDetectorDimensions, + detector_dimensions: DetectorBankSizes, ) -> CalibrationData: """Load the calibration data for the POWGEN test data.""" if filename is None: @@ -119,7 +119,7 @@ def pooch_load_calibration( def extract_raw_data( - dg: RawDataAndMetadata[RunType], sizes: NeXusDetectorDimensions + dg: RawDataAndMetadata[RunType], sizes: DetectorBankSizes ) -> DetectorData[RunType]: """Return the events from a loaded data group.""" # Remove the tof binning and dimension, as it is not needed and it gets in the way