File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 22# Copyright (c) 2025 Scipp contributors (https://github.com/scipp)
33"""Normalization routines for neutron data reduction."""
44
5- import itertools
5+ import functools
66
77import scipp as sc
88
@@ -228,17 +228,12 @@ def _mask_detector_for_norm(
228228
229229def _monitor_mask (monitor : sc .DataArray ) -> sc .Variable | None :
230230 """Mask nonfinite monitor values and combine all masks."""
231- masks = monitor .masks .values ()
231+ masks = list ( monitor .masks .values () )
232232
233233 finite = sc .isfinite (monitor .data )
234234 if not finite .all ():
235- masks = itertools . chain ( masks , ( ~ finite ,) )
235+ masks . append ( ~ finite )
236236
237- mask = None
238- for m in masks :
239- if mask is None :
240- mask = m
241- else :
242- mask |= m
243-
244- return mask
237+ if not masks :
238+ return None
239+ return functools .reduce (sc .logical_or , masks )
You can’t perform that action at this time.
0 commit comments