def test_do_actual_interpolation_many(self): inputs = np.array([1, 0, 0, 0, 0, 6]) got = bond_length_distribution.interpolate_zeros(inputs) np.testing.assert_almost_equal([1, 2, 3, 4, 5, 6], got)
def test_insert_multiple_regions(self): inputs = np.array([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1]) got = bond_length_distribution.interpolate_zeros(inputs) np.testing.assert_array_equal(np.ones(len(inputs), dtype=np.int32), got)
def test_do_actual_interpolation_one(self): inputs = np.array([1, 0, 2]) got = bond_length_distribution.interpolate_zeros(inputs) np.testing.assert_almost_equal([1.0, 1.5, 2.0], got)
def test_insert_one(self): inputs = np.array([1, 0, 1]) got = bond_length_distribution.interpolate_zeros(inputs) np.testing.assert_array_equal([1, 1, 1], got)