Coverage for install/scipp/core/dataset.py: 25%
4 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-11-17 01:51 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-11-17 01:51 +0000
1# SPDX-License-Identifier: BSD-3-Clause
2# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
3# @author Matthew Andrew
5from .._scipp import core as _cpp
6from ._cpp_wrapper_util import call_func as _call_cpp_func
9def irreducible_mask(masks: _cpp.Masks, dim: str) -> _cpp.Variable | None:
10 """Returns the union of all masks with irreducible dimension.
12 Irreducible means that a reduction operation must apply these masks since
13 they depend on the reduction dimension.
15 Parameters
16 ----------
17 masks:
18 Masks of a data array or dataset.
19 dim:
20 Dimension along which a reduction would be performed.
22 Returns
23 -------
24 :
25 Union of irreducible masks or ``None`` if there is no irreducible mask.
26 """
27 return _call_cpp_func(_cpp.irreducible_mask, masks, dim)