From b4ea318e6ddb882fffe62a70952a9a2ddd55ce7a Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Wed, 17 Feb 2016 15:16:14 +0100 Subject: [PATCH] coefficients: add comparison unittest --- artiq/test/test_coefficients.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/artiq/test/test_coefficients.py b/artiq/test/test_coefficients.py index 4b78cb3de..2f33ea8fd 100644 --- a/artiq/test/test_coefficients.py +++ b/artiq/test/test_coefficients.py @@ -32,6 +32,15 @@ class TestSplineCoef(unittest.TestCase): def test_run(self): return self.drive(self.test_synth()) + def test_compare(self): + scale = 100 + d = list(self.s.get_segment_data(start=0, stop=4, scale=1/scale)) + d[0]["trigger"] = True + s = compute_samples.Synthesizer(self.y.shape[0], [d]) + s.select(0) + y = s.trigger()[0] + np.testing.assert_almost_equal(y[::scale], self.y[0, :-1]) + @unittest.skip("manual/visual test") def test_plot(self): import matplotlib.pyplot as plt