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