File: test_3028_mask_bitmaskedarray.py

package info (click to toggle)
python-awkward 2.8.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,932 kB
  • sloc: python: 178,875; cpp: 33,828; sh: 432; makefile: 21; javascript: 8
file content (19 lines) | stat: -rw-r--r-- 470 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from __future__ import annotations

import numpy as np

import awkward as ak
from awkward.typetracer import unknown_length


def test():
    arr = (
        ak.mask([1, 2, 3], [True, False, False], highlevel=False)
        .to_BitMaskedArray(valid_when=True, lsb_order=True)
        .to_typetracer(forget_length=True)
    )

    result = arr.mask_as_bool()
    assert result.dtype == np.dtype("bool")
    assert result.ndim == 1
    assert result.size is unknown_length