summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-11-12 17:50:03 -0600
committerGitHub <noreply@github.com>2018-11-12 17:50:03 -0600
commitcd39348e8593dc2b41e2516fbdd8a69b0f0bda6e (patch)
tree0d943690a7d5821874a0c3bae127ebfb7cf1ea6c /numpy/lib/tests
parent7c41164f5340dc998ea1c04d2061f7d246894955 (diff)
parent9dff602e2e2250fa64df5f64927ee0e9652b2420 (diff)
downloadnumpy-cd39348e8593dc2b41e2516fbdd8a69b0f0bda6e.tar.gz
Merge pull request #12241 from tylerjereddy/histogramdd_test_arg_branch
TST: arg handling tests in histogramdd
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_histograms.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_histograms.py b/numpy/lib/tests/test_histograms.py
index 1b5a71d0e..5b51763b2 100644
--- a/numpy/lib/tests/test_histograms.py
+++ b/numpy/lib/tests/test_histograms.py
@@ -794,3 +794,20 @@ class TestHistogramdd(object):
hist_dd, edges_dd = histogramdd((v,), (bins,), density=True)
assert_equal(hist, hist_dd)
assert_equal(edges, edges_dd[0])
+
+ def test_density_via_normed(self):
+ # normed should simply alias to density argument
+ v = np.arange(10)
+ bins = np.array([0, 1, 3, 6, 10])
+ hist, edges = histogram(v, bins, density=True)
+ hist_dd, edges_dd = histogramdd((v,), (bins,), normed=True)
+ assert_equal(hist, hist_dd)
+ assert_equal(edges, edges_dd[0])
+
+ def test_density_normed_redundancy(self):
+ v = np.arange(10)
+ bins = np.array([0, 1, 3, 6, 10])
+ with assert_raises_regex(TypeError, "Cannot specify both"):
+ hist_dd, edges_dd = histogramdd((v,), (bins,),
+ density=True,
+ normed=True)