File: test_3300_allow_negative_axis_in_argcombinations.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 (22 lines) | stat: -rw-r--r-- 600 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from __future__ import annotations

import awkward as ak


def test():
    array = ak.Array([[0.0, 1.1, 2.2], [], [3.3, 4.4], [5.5], [6.6, 7.7, 8.8, 9.9]])

    assert ak.combinations(array, 2, axis=-1).tolist() == [
        [(0.0, 1.1), (0.0, 2.2), (1.1, 2.2)],
        [],
        [(3.3, 4.4)],
        [],
        [(6.6, 7.7), (6.6, 8.8), (6.6, 9.9), (7.7, 8.8), (7.7, 9.9), (8.8, 9.9)],
    ]
    assert ak.argcombinations(array, 2, axis=-1).tolist() == [
        [(0, 1), (0, 2), (1, 2)],
        [],
        [(0, 1)],
        [],
        [(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)],
    ]