Skip to content

Commit

Permalink
Add implementation of dpnp.histogram (#1785)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
antonwolfy committed Apr 29, 2024
1 parent f6f660c commit 8d04592
Show file tree
Hide file tree
Showing 13 changed files with 961 additions and 273 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
test_dparray.py
test_copy.py
test_fft.py
test_histogram.py
test_linalg.py
test_logic.py
test_manipulation.py
Expand Down Expand Up @@ -49,6 +50,7 @@ env:
third_party/cupy/math_tests
third_party/cupy/sorting_tests/test_sort.py
third_party/cupy/sorting_tests/test_count.py
third_party/cupy/statistics_tests/test_histogram.py
third_party/cupy/statistics_tests/test_meanvar.py
VER_JSON_NAME: 'version.json'
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
Expand Down
26 changes: 13 additions & 13 deletions doc/reference/statistics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,25 @@ Averages and variances
dpnp.median
dpnp.average
dpnp.mean
dpnp.var
dpnp.std
dpnp.var
dpnp.nanmean
dpnp.nanvar
dpnp.nanstd


Correlations
------------

.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.corrcoef
dpnp.cov
dpnp.correlate


Histograms
----------

Expand All @@ -47,15 +59,3 @@ Histograms
dpnp.bincount
dpnp.histogram_bin_edges
dpnp.digitize


Correlations
------------

.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.corrcoef
dpnp.cov
dpnp.correlate
3 changes: 3 additions & 0 deletions dpnp/dpnp_iface.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
from dpnp.dpnp_iface_bitwise import __all__ as __all__bitwise
from dpnp.dpnp_iface_counting import *
from dpnp.dpnp_iface_counting import __all__ as __all__counting
from dpnp.dpnp_iface_histograms import *
from dpnp.dpnp_iface_histograms import __all__ as __all__histograms
from dpnp.dpnp_iface_indexing import *
from dpnp.dpnp_iface_indexing import __all__ as __all__indexing
from dpnp.dpnp_iface_libmath import *
Expand Down Expand Up @@ -111,6 +113,7 @@
__all__ += __all__arraycreation
__all__ += __all__bitwise
__all__ += __all__counting
__all__ += __all__histograms
__all__ += __all__indexing
__all__ += __all__libmath
__all__ += __all__linearalgebra
Expand Down
Loading

0 comments on commit 8d04592

Please sign in to comment.