def assert_is_linear(self, signal, decimals=5): """Assert that the signal is linear.""" self.assertTrue(is_linear(signal, decimals=decimals))
def test_is_linear(self): """Test the is_linear function.""" x = np.arange(10) self.assertTrue(utils.is_linear(x)) x = np.sin(x) self.assertFalse(utils.is_linear(x))