Skip to content

Commit 8d04592

Browse files
authored
Add implementation of dpnp.histogram (#1785)
* Implement dpnp.histogram * Updated third party tests for histogram * Updated histogram tests due to new dpnp.cumsum() impl * Applied pre-commit checks * Added dpnp tests * Added CFD tests * Renamed test_histogram.py * Updated tests to run on Iris Xe * Get rid of block size * Addressed review comments * Leftovers from rebase * Cast bin edges to default floating type if density is enabled
1 parent f6f660c commit 8d04592

File tree

13 files changed

+961
-273
lines changed

13 files changed

+961
-273
lines changed

.github/workflows/conda-package.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ env:
2222
test_dparray.py
2323
test_copy.py
2424
test_fft.py
25+
test_histogram.py
2526
test_linalg.py
2627
test_logic.py
2728
test_manipulation.py
@@ -49,6 +50,7 @@ env:
4950
third_party/cupy/math_tests
5051
third_party/cupy/sorting_tests/test_sort.py
5152
third_party/cupy/sorting_tests/test_count.py
53+
third_party/cupy/statistics_tests/test_histogram.py
5254
third_party/cupy/statistics_tests/test_meanvar.py
5355
VER_JSON_NAME: 'version.json'
5456
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "

doc/reference/statistics.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,25 @@ Averages and variances
2727
dpnp.median
2828
dpnp.average
2929
dpnp.mean
30-
dpnp.var
3130
dpnp.std
31+
dpnp.var
3232
dpnp.nanmean
3333
dpnp.nanvar
3434
dpnp.nanstd
3535

3636

37+
Correlations
38+
------------
39+
40+
.. autosummary::
41+
:toctree: generated/
42+
:nosignatures:
43+
44+
dpnp.corrcoef
45+
dpnp.cov
46+
dpnp.correlate
47+
48+
3749
Histograms
3850
----------
3951

@@ -47,15 +59,3 @@ Histograms
4759
dpnp.bincount
4860
dpnp.histogram_bin_edges
4961
dpnp.digitize
50-
51-
52-
Correlations
53-
------------
54-
55-
.. autosummary::
56-
:toctree: generated/
57-
:nosignatures:
58-
59-
dpnp.corrcoef
60-
dpnp.cov
61-
dpnp.correlate

dpnp/dpnp_iface.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
from dpnp.dpnp_iface_bitwise import __all__ as __all__bitwise
7979
from dpnp.dpnp_iface_counting import *
8080
from dpnp.dpnp_iface_counting import __all__ as __all__counting
81+
from dpnp.dpnp_iface_histograms import *
82+
from dpnp.dpnp_iface_histograms import __all__ as __all__histograms
8183
from dpnp.dpnp_iface_indexing import *
8284
from dpnp.dpnp_iface_indexing import __all__ as __all__indexing
8385
from dpnp.dpnp_iface_libmath import *
@@ -111,6 +113,7 @@
111113
__all__ += __all__arraycreation
112114
__all__ += __all__bitwise
113115
__all__ += __all__counting
116+
__all__ += __all__histograms
114117
__all__ += __all__indexing
115118
__all__ += __all__libmath
116119
__all__ += __all__linearalgebra

0 commit comments

Comments
 (0)