Test that adjacent entries in an edge array can be equal
(self)
| 743 | range=[[0.0, 1.0], [np.nan, 0.75], [0.25, 0.5]]) |
| 744 | |
| 745 | def test_equal_edges(self): |
| 746 | """ Test that adjacent entries in an edge array can be equal """ |
| 747 | x = np.array([0, 1, 2]) |
| 748 | y = np.array([0, 1, 2]) |
| 749 | x_edges = np.array([0, 2, 2]) |
| 750 | y_edges = 1 |
| 751 | hist, edges = histogramdd((x, y), bins=(x_edges, y_edges)) |
| 752 | |
| 753 | hist_expected = np.array([ |
| 754 | [2.], |
| 755 | [1.], # x == 2 falls in the final bin |
| 756 | ]) |
| 757 | assert_equal(hist, hist_expected) |
| 758 | |
| 759 | def test_edge_dtype(self): |
| 760 | """ Test that if an edge array is input, its type is preserved """ |
nothing calls this directly
no test coverage detected