summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_histograms.py
diff options
context:
space:
mode:
authorJack J. Woehr <jwoehr@softwoehr.com>2019-10-18 15:25:03 -0600
committerJack J. Woehr <jwoehr@softwoehr.com>2019-10-18 15:25:03 -0600
commitcc3da40d52cb46a346bf429b8d76d7fd59e29887 (patch)
tree3a0cf76b27723817e5520d877df1685ce7f4223d /numpy/lib/tests/test_histograms.py
parent4d4cc4dcf4feaa6c3162b0d07b0f687e477724ad (diff)
parentc1f56c455252e4c2dd2535f0ce140125aff8ece2 (diff)
downloadnumpy-cc3da40d52cb46a346bf429b8d76d7fd59e29887.tar.gz
Merge branch 'master' of https://github.com/numpy/numpy into einsum_c_buglet
Diffstat (limited to 'numpy/lib/tests/test_histograms.py')
-rw-r--r--numpy/lib/tests/test_histograms.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_histograms.py b/numpy/lib/tests/test_histograms.py
index 4895a722c..dbf189f3e 100644
--- a/numpy/lib/tests/test_histograms.py
+++ b/numpy/lib/tests/test_histograms.py
@@ -8,6 +8,7 @@ from numpy.testing import (
assert_array_almost_equal, assert_raises, assert_allclose,
assert_array_max_ulp, assert_raises_regex, suppress_warnings,
)
+import pytest
class TestHistogram(object):
@@ -591,6 +592,16 @@ class TestHistogramOptimBinNums(object):
msg += " with datasize of {0}".format(testlen)
assert_equal(len(a), numbins, err_msg=msg)
+ @pytest.mark.parametrize("bins", ['auto', 'fd', 'doane', 'scott',
+ 'stone', 'rice', 'sturges'])
+ def test_signed_integer_data(self, bins):
+ # Regression test for gh-14379.
+ a = np.array([-2, 0, 127], dtype=np.int8)
+ hist, edges = np.histogram(a, bins=bins)
+ hist32, edges32 = np.histogram(a.astype(np.int32), bins=bins)
+ assert_array_equal(hist, hist32)
+ assert_array_equal(edges, edges32)
+
def test_simple_weighted(self):
"""
Check that weighted data raises a TypeError