Skip to content

Commit 5d28262

Browse files
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 8d04592
1 parent 3e3ec06 commit 5d28262

File tree

488 files changed

+3646
-3868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

488 files changed

+3646
-3868
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 9143ba1f899a748fed07635a651250b3
3+
config: a7a3c29df81a7e539d95902eeca7dddb
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_modules/dpnp/dpnp_array.html

Lines changed: 72 additions & 108 deletions
Large diffs are not rendered by default.

_modules/dpnp/dpnp_flatiter.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.15.0dev1+62.g651e98a28a documentation</title>
15+
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.15.0dev1+43.g8d0459283 documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=ab42fab7"></script>
26+
<script src="../../_static/documentation_options.js?v=96479cd5"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.15.0dev1+62.g651e98a28a
46+
0.15.0dev1+43.g8d0459283
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

_modules/dpnp/dpnp_iface.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.15.0dev1+62.g651e98a28a documentation</title>
15+
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.15.0dev1+43.g8d0459283 documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=ab42fab7"></script>
26+
<script src="../../_static/documentation_options.js?v=96479cd5"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.15.0dev1+62.g651e98a28a
46+
0.15.0dev1+43.g8d0459283
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
@@ -308,8 +308,8 @@ <h1>Source code for dpnp.dpnp_iface</h1><div class="highlight"><pre>
308308
<span class="sd"> - &#39;unsafe&#39; means any data conversions may be done.</span>
309309

310310
<span class="sd"> copy : bool, optional</span>
311-
<span class="sd"> By default, ``astype`` always returns a newly allocated array. If this</span>
312-
<span class="sd"> is set to ``False``, and the `dtype`, `order`, and `subok` requirements</span>
311+
<span class="sd"> By default, astype always returns a newly allocated array. If this</span>
312+
<span class="sd"> is set to ``False``, and the dtype, order, and subok requirements</span>
313313
<span class="sd"> are satisfied, the input array is returned instead of a copy.</span>
314314

315315
<span class="sd"> Returns</span>

_modules/dpnp/dpnp_iface_arraycreation.html

Lines changed: 45 additions & 44 deletions
Large diffs are not rendered by default.

_modules/dpnp/dpnp_iface_counting.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.15.0dev1+62.g651e98a28a documentation</title>
15+
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.15.0dev1+43.g8d0459283 documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=ab42fab7"></script>
26+
<script src="../../_static/documentation_options.js?v=96479cd5"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.15.0dev1+62.g651e98a28a
46+
0.15.0dev1+43.g8d0459283
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

_modules/dpnp/dpnp_iface_histograms.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_histograms &mdash; Data Parallel Extension for NumPy 0.15.0dev1+62.g651e98a28a documentation</title>
15+
<title>dpnp.dpnp_iface_histograms &mdash; Data Parallel Extension for NumPy 0.15.0dev1+43.g8d0459283 documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=ab42fab7"></script>
26+
<script src="../../_static/documentation_options.js?v=96479cd5"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.15.0dev1+62.g651e98a28a
46+
0.15.0dev1+43.g8d0459283
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

_modules/dpnp/dpnp_iface_indexing.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_indexing &mdash; Data Parallel Extension for NumPy 0.15.0dev1+62.g651e98a28a documentation</title>
15+
<title>dpnp.dpnp_iface_indexing &mdash; Data Parallel Extension for NumPy 0.15.0dev1+43.g8d0459283 documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=ab42fab7"></script>
26+
<script src="../../_static/documentation_options.js?v=96479cd5"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.15.0dev1+62.g651e98a28a
46+
0.15.0dev1+43.g8d0459283
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
@@ -529,12 +529,12 @@ <h1>Source code for dpnp.dpnp_iface_indexing</h1><div class="highlight"><pre>
529529
<span class="sd"> out : one dpnp.ndarray or tuple of dpnp.ndarray</span>
530530
<span class="sd"> If sparse is ``False``:</span>
531531
<span class="sd"> Returns one array of grid indices,</span>
532-
<span class="sd"> ``grid.shape = (len(dimensions),) + tuple(dimensions)``.</span>
532+
<span class="sd"> grid.shape = (len(dimensions),) + tuple(dimensions).</span>
533533

534534
<span class="sd"> If sparse is ``True``:</span>
535535
<span class="sd"> Returns a tuple of arrays,</span>
536536
<span class="sd"> with grid[i].shape = (1, ..., 1, dimensions[i], 1, ..., 1)</span>
537-
<span class="sd"> with dimensions[i] in the i-th place.</span>
537+
<span class="sd"> with dimensions[i] in the ith place.</span>
538538

539539
<span class="sd"> Examples</span>
540540
<span class="sd"> --------</span>
@@ -907,8 +907,7 @@ <h1>Source code for dpnp.dpnp_iface_indexing</h1><div class="highlight"><pre>
907907
<a class="viewcode-back" href="../../reference/generated/dpnp.select.html#dpnp.select">[docs]</a>
908908
<span class="k">def</span> <span class="nf">select</span><span class="p">(</span><span class="n">condlist</span><span class="p">,</span> <span class="n">choicelist</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
909909
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
910-
<span class="sd"> Return an array drawn from elements in `choicelist`, depending on</span>
911-
<span class="sd"> conditions.</span>
910+
<span class="sd"> Return an array drawn from elements in choicelist, depending on conditions.</span>
912911

913912
<span class="sd"> For full documentation refer to :obj:`numpy.select`.</span>
914913

@@ -1065,8 +1064,7 @@ <h1>Source code for dpnp.dpnp_iface_indexing</h1><div class="highlight"><pre>
10651064
<span class="sd"> &gt;&gt;&gt; import dpnp as np</span>
10661065
<span class="sd"> &gt;&gt;&gt; a = np.array([[10, 30, 20], [60, 40, 50]])</span>
10671066

1068-
<span class="sd"> We can sort either by using :obj:`dpnp.sort` directly, or</span>
1069-
<span class="sd"> :obj:`dpnp.argsort` and this function:</span>
1067+
<span class="sd"> We can sort either by using sort directly, or argsort and this function</span>
10701068

10711069
<span class="sd"> &gt;&gt;&gt; np.sort(a, axis=1)</span>
10721070
<span class="sd"> array([[10, 20, 30],</span>
@@ -1094,7 +1092,7 @@ <h1>Source code for dpnp.dpnp_iface_indexing</h1><div class="highlight"><pre>
10941092
<span class="sd"> [60]])</span>
10951093

10961094
<span class="sd"> If we want to get the max and min at the same time, we can stack the</span>
1097-
<span class="sd"> indices first:</span>
1095+
<span class="sd"> indices first</span>
10981096

10991097
<span class="sd"> &gt;&gt;&gt; ai_min = np.argmin(a, axis=1, keepdims=True)</span>
11001098
<span class="sd"> &gt;&gt;&gt; ai_max = np.argmax(a, axis=1, keepdims=True)</span>

_modules/dpnp/dpnp_iface_libmath.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_libmath &mdash; Data Parallel Extension for NumPy 0.15.0dev1+62.g651e98a28a documentation</title>
15+
<title>dpnp.dpnp_iface_libmath &mdash; Data Parallel Extension for NumPy 0.15.0dev1+43.g8d0459283 documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=ab42fab7"></script>
26+
<script src="../../_static/documentation_options.js?v=96479cd5"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.15.0dev1+62.g651e98a28a
46+
0.15.0dev1+43.g8d0459283
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">

_modules/dpnp/dpnp_iface_linearalgebra.html

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
15-
<title>dpnp.dpnp_iface_linearalgebra &mdash; Data Parallel Extension for NumPy 0.15.0dev1+62.g651e98a28a documentation</title>
15+
<title>dpnp.dpnp_iface_linearalgebra &mdash; Data Parallel Extension for NumPy 0.15.0dev1+43.g8d0459283 documentation</title>
1616
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1717
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=19f00094" />
1818

@@ -23,7 +23,7 @@
2323

2424
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2525
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
26-
<script src="../../_static/documentation_options.js?v=ab42fab7"></script>
26+
<script src="../../_static/documentation_options.js?v=96479cd5"></script>
2727
<script src="../../_static/doctools.js?v=9a2dae69"></script>
2828
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2929
<script src="../../_static/js/theme.js"></script>
@@ -43,7 +43,7 @@
4343
Data Parallel Extension for NumPy
4444
</a>
4545
<div class="version">
46-
0.15.0dev1+62.g651e98a28a
46+
0.15.0dev1+43.g8d0459283
4747
</div>
4848
<div role="search">
4949
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
@@ -344,7 +344,7 @@ <h1>Source code for dpnp.dpnp_iface_linearalgebra</h1><div class="highlight"><pr
344344
<span class="sd"> See Also</span>
345345
<span class="sd"> --------</span>
346346
<span class="sd"> :obj:`dpnp.einsum` : Einstein summation convention..</span>
347-
<span class="sd"> :obj:`dpnp.dot` : Generalized matrix product,</span>
347+
<span class="sd"> :obj:`dpnp.dot` : Generalised matrix product,</span>
348348
<span class="sd"> using second last dimension of `b`.</span>
349349
<span class="sd"> :obj:`dpnp.tensordot` : Sum products over arbitrary axes.</span>
350350

@@ -409,10 +409,7 @@ <h1>Source code for dpnp.dpnp_iface_linearalgebra</h1><div class="highlight"><pr
409409
<a class="viewcode-back" href="../../reference/generated/dpnp.kron.html#dpnp.kron">[docs]</a>
410410
<span class="k">def</span> <span class="nf">kron</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">):</span>
411411
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
412-
<span class="sd"> Kronecker product of two arrays.</span>
413-
414-
<span class="sd"> Computes the Kronecker product, a composite array made of blocks of the</span>
415-
<span class="sd"> second array scaled by the first.</span>
412+
<span class="sd"> Returns the kronecker product of two arrays.</span>
416413

417414
<span class="sd"> For full documentation refer to :obj:`numpy.kron`.</span>
418415

@@ -713,7 +710,7 @@ <h1>Source code for dpnp.dpnp_iface_linearalgebra</h1><div class="highlight"><pr
713710
<span class="sd"> Returns</span>
714711
<span class="sd"> -------</span>
715712
<span class="sd"> out : dpnp.ndarray</span>
716-
<span class="sd"> Returns the tensor dot product of `a` and `b`.</span>
713+
<span class="sd"> Returns the tensordot product of `a` and `b`.</span>
717714

718715
<span class="sd"> See Also</span>
719716
<span class="sd"> --------</span>
@@ -792,7 +789,7 @@ <h1>Source code for dpnp.dpnp_iface_linearalgebra</h1><div class="highlight"><pr
792789
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">axes</span><span class="p">,</span> <span class="nb">int</span><span class="p">):</span>
793790
<span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s2">&quot;Axes must be an integer.&quot;</span><span class="p">)</span> <span class="kn">from</span> <span class="nn">e</span>
794791
<span class="k">if</span> <span class="n">axes</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">:</span>
795-
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Axes must be a non-negative integer.&quot;</span><span class="p">)</span> <span class="kn">from</span> <span class="nn">e</span>
792+
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Axes must be a nonnegative integer.&quot;</span><span class="p">)</span> <span class="kn">from</span> <span class="nn">e</span>
796793
<span class="n">axes_a</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="o">-</span><span class="n">axes</span><span class="p">,</span> <span class="mi">0</span><span class="p">))</span>
797794
<span class="n">axes_b</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">axes</span><span class="p">))</span>
798795
<span class="k">else</span><span class="p">:</span>

0 commit comments

Comments
 (0)