essreduce 25.2.0__py3-none-any.whl → 25.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ess/reduce/__init__.py CHANGED
@@ -1,10 +1,10 @@
1
1
  # SPDX-License-Identifier: BSD-3-Clause
2
- # Copyright (c) 2024 Scipp contributors (https://github.com/scipp)
3
- # ruff: noqa: E402, F401
2
+ # Copyright (c) 2025 Scipp contributors (https://github.com/scipp)
3
+ # ruff: noqa: E402, F401, I
4
4
 
5
5
  import importlib.metadata
6
6
 
7
- from . import nexus, uncertainty, time_of_flight
7
+ from . import nexus, time_of_flight, uncertainty
8
8
 
9
9
  try:
10
10
  __version__ = importlib.metadata.version("essreduce")
@@ -13,4 +13,4 @@ except importlib.metadata.PackageNotFoundError:
13
13
 
14
14
  del importlib
15
15
 
16
- __all__ = ["nexus", "uncertainty", "time_of_flight"]
16
+ __all__ = ["nexus", "time_of_flight", "uncertainty"]
ess/reduce/live/raw.py CHANGED
@@ -255,10 +255,19 @@ class RollingDetectorView(Detector):
255
255
  self._projection = projection
256
256
  self._window = window
257
257
  self._current = 0
258
- self._history: sc.DataArray | None = None
259
- self._cache: sc.DataArray | None = None
258
+ self._history: sc.DataArray
259
+ self._cache: sc.DataArray
260
+ self._cumulative: sc.DataArray
260
261
  self.clear_counts()
261
262
 
263
+ @property
264
+ def max_window(self) -> int:
265
+ return self._window
266
+
267
+ @property
268
+ def cumulative(self) -> sc.DataArray:
269
+ return self._cumulative
270
+
262
271
  def clear_counts(self) -> None:
263
272
  """
264
273
  Clear counts.
@@ -275,6 +284,7 @@ class RollingDetectorView(Detector):
275
284
  .copy()
276
285
  )
277
286
  self._cache = self._history.sum('window')
287
+ self._cumulative = sc.zeros_like(self._cache)
278
288
 
279
289
  def make_roi_filter(self) -> roi.ROIFilter:
280
290
  """Return a ROI filter operating via the projection plane of the view."""
@@ -494,6 +504,7 @@ class RollingDetectorView(Detector):
494
504
  self._cache -= self._history['window', self._current]
495
505
  self._history['window', self._current] = counts
496
506
  self._cache += counts
507
+ self._cumulative += counts
497
508
  self._current = (self._current + 1) % self._window
498
509
 
499
510
 
@@ -13,23 +13,23 @@ The submodule :mod:`types` defines all domain types.
13
13
  """
14
14
 
15
15
  from . import types
16
- from .workflow import GenericNeXusWorkflow
17
16
  from ._nexus_loader import (
18
- load_data,
19
- group_event_data,
20
- load_component,
21
- load_all_components,
22
17
  compute_component_position,
23
18
  extract_signal_data_array,
19
+ group_event_data,
20
+ load_all_components,
21
+ load_component,
22
+ load_data,
24
23
  )
24
+ from .workflow import GenericNeXusWorkflow
25
25
 
26
26
  __all__ = [
27
- 'types',
27
+ 'GenericNeXusWorkflow',
28
+ 'compute_component_position',
29
+ 'extract_signal_data_array',
28
30
  'group_event_data',
29
31
  'load_all_components',
30
- 'load_data',
31
32
  'load_component',
32
- 'compute_component_position',
33
- 'extract_signal_data_array',
34
- 'GenericNeXusWorkflow',
33
+ 'load_data',
34
+ 'types',
35
35
  ]
@@ -7,8 +7,8 @@ neutron time-of-arrival at the detectors.
7
7
  """
8
8
 
9
9
  from .simulation import simulate_beamline
10
- from .toa_to_tof import default_parameters, resample_tof_data, providers
11
10
  from .to_events import to_events
11
+ from .toa_to_tof import default_parameters, providers, resample_tof_data
12
12
  from .types import (
13
13
  DistanceResolution,
14
14
  LookupTableRelativeErrorThreshold,
@@ -25,7 +25,6 @@ from .types import (
25
25
  TofData,
26
26
  )
27
27
 
28
-
29
28
  __all__ = [
30
29
  "DistanceResolution",
31
30
  "LookupTableRelativeErrorThreshold",
@@ -7,29 +7,28 @@ from typing import Any, Protocol
7
7
  import ipywidgets as widgets
8
8
 
9
9
  from ..parameter import (
10
+ BinEdgesParameter,
10
11
  BooleanParameter,
11
12
  FilenameParameter,
12
13
  MultiFilenameParameter,
13
14
  MultiStringParameter,
14
- ParamWithOptions,
15
- StringParameter,
16
15
  Parameter,
17
16
  ParamWithBounds,
18
- BinEdgesParameter,
17
+ ParamWithOptions,
18
+ StringParameter,
19
19
  Vector2dParameter,
20
20
  Vector3dParameter,
21
21
  )
22
- from ._config import default_layout, default_style
23
-
24
22
  from ._binedges_widget import BinEdgesWidget
23
+ from ._bounds_widget import BoundsWidget
24
+ from ._config import default_layout, default_style
25
25
  from ._filename_widget import FilenameWidget, MultiFilenameWidget
26
26
  from ._linspace_widget import LinspaceWidget
27
- from ._vector_widget import VectorWidget
28
- from ._bounds_widget import BoundsWidget
29
- from ._string_widget import MultiStringWidget, StringWidget
30
- from ._switchable_widget import SwitchWidget
31
27
  from ._optional_widget import OptionalWidget
32
28
  from ._spinner import Spinner
29
+ from ._string_widget import MultiStringWidget, StringWidget
30
+ from ._switchable_widget import SwitchWidget
31
+ from ._vector_widget import VectorWidget
33
32
 
34
33
 
35
34
  class EssWidget(Protocol):
@@ -189,8 +188,8 @@ __all__ = [
189
188
  'LinspaceWidget',
190
189
  'MultiFilenameWidget',
191
190
  'OptionalWidget',
191
+ 'Spinner',
192
192
  'SwitchWidget',
193
193
  'VectorWidget',
194
194
  'create_parameter_widget',
195
- 'Spinner',
196
195
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: essreduce
3
- Version: 25.2.0
3
+ Version: 25.2.1
4
4
  Summary: Common data reduction tools for the ESS facility
5
5
  Author: Scipp contributors
6
6
  License: BSD 3-Clause License
@@ -1,4 +1,4 @@
1
- ess/reduce/__init__.py,sha256=UPoVUoZ4oVwNLcAkkkCvc78hV3R8v9Q8oCxykp9WH4s,416
1
+ ess/reduce/__init__.py,sha256=o1pWRP9YGwTukM_k-qlG6KcoXOpMb0PDVH59vod12lw,419
2
2
  ess/reduce/data.py,sha256=vaoeAJ6EpK1YghOiAALLdWiW17TgUnnnt0H-RGiGzXk,3756
3
3
  ess/reduce/logging.py,sha256=6n8Czq4LZ3OK9ENlKsWSI1M3KvKv6_HSoUiV4__IUlU,357
4
4
  ess/reduce/parameter.py,sha256=4sCfoKOI2HuO_Q7JLH_jAXnEOFANSn5P3NdaOBzhJxc,4635
@@ -8,23 +8,23 @@ ess/reduce/ui.py,sha256=zmorAbDwX1cU3ygDT--OP58o0qU7OBcmJz03jPeYSLA,10884
8
8
  ess/reduce/uncertainty.py,sha256=LR4O6ApB6Z-W9gC_XW0ajupl8yFG-du0eee1AX_R-gk,6990
9
9
  ess/reduce/workflow.py,sha256=sL34T_2Cjl_8iFlegujxI9VyOUwo6erVC8pOXnfWgYw,3060
10
10
  ess/reduce/live/__init__.py,sha256=jPQVhihRVNtEDrE20PoKkclKV2aBF1lS7cCHootgFgI,204
11
- ess/reduce/live/raw.py,sha256=o1Q3t07qPPncCMtZOk6x17OUzhWFXGfy4WeO0YGEw4Y,24997
11
+ ess/reduce/live/raw.py,sha256=W7AxwFApqBzYki-Y_pIt9jZqzcvJnRMsdt1Hu1He4v0,25262
12
12
  ess/reduce/live/roi.py,sha256=6EwQNjGLk5y2zwI99YIVw6Q7si7U25Ou_IM_kLfkkAU,3719
13
13
  ess/reduce/live/workflow.py,sha256=bsbwvTqPhRO6mC__3b7MgU7DWwAnOvGvG-t2n22EKq8,4285
14
- ess/reduce/nexus/__init__.py,sha256=PxJkhlGcFRzVU4SICBhymK5_5FjM5oXPZ8YUpd0v1pE,967
14
+ ess/reduce/nexus/__init__.py,sha256=59bxKkNYg8DYcSykNvH6nCa5SYchJC4SbgZEKhkNdYc,967
15
15
  ess/reduce/nexus/_nexus_loader.py,sha256=NbKIepTxv-UirVlViImh8Ozm16k-ZIiF6AQ9-oKuDHU,19222
16
16
  ess/reduce/nexus/json_generator.py,sha256=ME2Xn8L7Oi3uHJk9ZZdCRQTRX-OV_wh9-DJn07Alplk,2529
17
17
  ess/reduce/nexus/json_nexus.py,sha256=QrVc0p424nZ5dHX9gebAJppTw6lGZq9404P_OFl1giA,10282
18
18
  ess/reduce/nexus/types.py,sha256=Az_pZtaTIlEAA4Po_YOLabez8w4HeHcr0asY3rS6BXg,9676
19
19
  ess/reduce/nexus/workflow.py,sha256=jzdh0ubp9Mmb98a04KIeM8Xo9bpAqpnsfwFWz2VllnQ,23676
20
20
  ess/reduce/scripts/grow_nexus.py,sha256=hET3h06M0xlJd62E3palNLFvJMyNax2kK4XyJcOhl-I,3387
21
- ess/reduce/time_of_flight/__init__.py,sha256=VJWy8kXJ-QaVWWed7C9rLhCpZ7MrkXuv9-8cV-U7TQ4,1098
21
+ ess/reduce/time_of_flight/__init__.py,sha256=92w88NpGIBysuqCPSvdZ_XgBd7cFAk9qaO9zflpUbfM,1097
22
22
  ess/reduce/time_of_flight/fakes.py,sha256=UyYxvtnb8QDdCgwaOhe0guRGCKP1DFr0wPXUPO3RNYU,6730
23
23
  ess/reduce/time_of_flight/simulation.py,sha256=CireE9m9kFbUXhGUeY2L3SoMy7kpqopxKj__h4tSKzo,2614
24
24
  ess/reduce/time_of_flight/to_events.py,sha256=_5CcUOWvguDcK8uo2pPZWzXnWoiZhC1w-zF8xysaIvU,4339
25
25
  ess/reduce/time_of_flight/toa_to_tof.py,sha256=crvNe6GIwHLrSUE_C3omDfroIujoH1rphwWhX8Dj25U,20601
26
26
  ess/reduce/time_of_flight/types.py,sha256=fIgnLKv6QolevXwrY5hD2-eC_7wtNlVJ-k6CvaeRJQk,5014
27
- ess/reduce/widgets/__init__.py,sha256=wk5ihxvtZHqkp2EYVtbJr1Es0lw69KQpyTSaizNgWjU,5326
27
+ ess/reduce/widgets/__init__.py,sha256=SoSHBv8Dc3QXV9HUvPhjSYWMwKTGYZLpsWwsShIO97Q,5325
28
28
  ess/reduce/widgets/_base.py,sha256=_wN3FOlXgx_u0c-A_3yyoIH-SdUvDENGgquh9S-h5GI,4852
29
29
  ess/reduce/widgets/_binedges_widget.py,sha256=ZCQsGjYHnJr9GFUn7NjoZc1CdsnAzm_fMzyF-fTKKVY,2785
30
30
  ess/reduce/widgets/_bounds_widget.py,sha256=CAyswvMA49mGMl2413TKBMbuG0ULCQPEaSODq8ghiDo,1084
@@ -36,9 +36,9 @@ ess/reduce/widgets/_spinner.py,sha256=2VY4Fhfa7HMXox2O7UbofcdKsYG-AJGrsgGJB85nDX
36
36
  ess/reduce/widgets/_string_widget.py,sha256=iPAdfANyXHf-nkfhgkyH6gQDklia0LebLTmwi3m-iYQ,1482
37
37
  ess/reduce/widgets/_switchable_widget.py,sha256=fjKz99SKLhIF1BLgGVBSKKn3Lu_jYBwDYGeAjbJY3Q8,2390
38
38
  ess/reduce/widgets/_vector_widget.py,sha256=aTaBqCFHZQhrIoX6-sSqFWCPePEW8HQt5kUio8jP1t8,1203
39
- essreduce-25.2.0.dist-info/LICENSE,sha256=nVEiume4Qj6jMYfSRjHTM2jtJ4FGu0g-5Sdh7osfEYw,1553
40
- essreduce-25.2.0.dist-info/METADATA,sha256=43hbId31E_VE73MQpwhFxaBgLsHuzx_rI2RQg1IBtSI,3708
41
- essreduce-25.2.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
42
- essreduce-25.2.0.dist-info/entry_points.txt,sha256=PMZOIYzCifHMTe4pK3HbhxUwxjFaZizYlLD0td4Isb0,66
43
- essreduce-25.2.0.dist-info/top_level.txt,sha256=0JxTCgMKPLKtp14wb1-RKisQPQWX7i96innZNvHBr-s,4
44
- essreduce-25.2.0.dist-info/RECORD,,
39
+ essreduce-25.2.1.dist-info/LICENSE,sha256=nVEiume4Qj6jMYfSRjHTM2jtJ4FGu0g-5Sdh7osfEYw,1553
40
+ essreduce-25.2.1.dist-info/METADATA,sha256=AqgfWVMhwbnavRMIKIBEWP4VrAwoffeiPV426JGrATs,3708
41
+ essreduce-25.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
42
+ essreduce-25.2.1.dist-info/entry_points.txt,sha256=PMZOIYzCifHMTe4pK3HbhxUwxjFaZizYlLD0td4Isb0,66
43
+ essreduce-25.2.1.dist-info/top_level.txt,sha256=0JxTCgMKPLKtp14wb1-RKisQPQWX7i96innZNvHBr-s,4
44
+ essreduce-25.2.1.dist-info/RECORD,,