def test_desired_number_of_modes_enough_data(self): results = np.arange(75).reshape(3, 25) value = metrics.desired_number_of_modes(results, [1, 5, 15, 25]) np.testing.assert_equal( value, np.array([[0, 4, 14, 24], [25, 29, 39, 49], [50, 54, 64, 74]]))
def test_desired_number_of_modes_not_enough(self): results = np.arange(30).reshape(2, 15) value = metrics.desired_number_of_modes(results, [1, 5, 15, 25]) np.testing.assert_equal(value, np.array([[0, 4, 14, 14], [15, 19, 29, 29]]))
def test_desired_number_of_modes_one_mode(self): results = np.ones((10, 1)) value = metrics.desired_number_of_modes(results, [1, 5, 15, 25]) np.testing.assert_equal(value, np.ones((10, 4)))