MCPcopy Create free account
hub / github.com/numpy/numpy / test_rightmost_binedge

Method test_rightmost_binedge

numpy/lib/tests/test_histograms.py:714–735  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

712 assert_allclose(h, expected)
713
714 def test_rightmost_binedge(self):
715 # Test event very close to rightmost binedge. See Github issue #4266
716 x = [0.9999999995]
717 bins = [[0., 0.5, 1.0]]
718 hist, _ = histogramdd(x, bins=bins)
719 assert_(hist[0] == 0.0)
720 assert_(hist[1] == 1.)
721 x = [1.0]
722 bins = [[0., 0.5, 1.0]]
723 hist, _ = histogramdd(x, bins=bins)
724 assert_(hist[0] == 0.0)
725 assert_(hist[1] == 1.)
726 x = [1.0000000001]
727 bins = [[0., 0.5, 1.0]]
728 hist, _ = histogramdd(x, bins=bins)
729 assert_(hist[0] == 0.0)
730 assert_(hist[1] == 0.0)
731 x = [1.0001]
732 bins = [[0., 0.5, 1.0]]
733 hist, _ = histogramdd(x, bins=bins)
734 assert_(hist[0] == 0.0)
735 assert_(hist[1] == 0.0)
736
737 def test_finite_range(self):
738 vals = np.random.random((100, 3))

Callers

nothing calls this directly

Calls 2

histogramddFunction · 0.90
assert_Function · 0.90

Tested by

no test coverage detected