summaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/numpy/typing/tests/data/reveal/histograms.pyi
blob: c1c63d59cb8805237e1d4907f2e90ef6f6ee4cfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from typing import Any, assert_type

import numpy as np
import numpy.typing as npt

AR_i8: npt.NDArray[np.int64]
AR_f8: npt.NDArray[np.float64]

assert_type(np.histogram_bin_edges(AR_i8, bins="auto"), npt.NDArray[Any])
assert_type(np.histogram_bin_edges(AR_i8, bins="rice", range=(0, 3)), npt.NDArray[Any])
assert_type(np.histogram_bin_edges(AR_i8, bins="scott", weights=AR_f8), npt.NDArray[Any])

assert_type(np.histogram(AR_i8, bins="auto"), tuple[npt.NDArray[Any], npt.NDArray[Any]])
assert_type(np.histogram(AR_i8, bins="rice", range=(0, 3)), tuple[npt.NDArray[Any], npt.NDArray[Any]])
assert_type(np.histogram(AR_i8, bins="scott", weights=AR_f8), tuple[npt.NDArray[Any], npt.NDArray[Any]])
assert_type(np.histogram(AR_f8, bins=1, density=True), tuple[npt.NDArray[Any], npt.NDArray[Any]])

assert_type(np.histogramdd(AR_i8, bins=[1]),
            tuple[npt.NDArray[Any], tuple[npt.NDArray[Any], ...]])
assert_type(np.histogramdd(AR_i8, range=[(0, 3)]),
            tuple[npt.NDArray[Any], tuple[npt.NDArray[Any], ...]])
assert_type(np.histogramdd(AR_i8, weights=AR_f8),
            tuple[npt.NDArray[Any], tuple[npt.NDArray[Any], ...]])
assert_type(np.histogramdd(AR_f8, density=True),
            tuple[npt.NDArray[Any], tuple[npt.NDArray[Any], ...]])