def test_rfft_freq_execution(setup): t = rfftfreq(20, .1, chunk_size=6) res = t.execute().fetch() np.testing.assert_allclose(res, np.fft.rfftfreq(20, .1)) t = rfftfreq(21, .01, chunk_size=6) res = t.execute().fetch() np.testing.assert_allclose(res, np.fft.rfftfreq(21, .01))
def testRFFTFreqExecution(self): t = rfftfreq(20, .1, chunk_size=3) res = self.executor.execute_tensor(t, concat=True)[0] np.testing.assert_allclose(res, np.fft.rfftfreq(20, .1)) t = rfftfreq(21, .01, chunk_size=3) res = self.executor.execute_tensor(t, concat=True)[0] np.testing.assert_allclose(res, np.fft.rfftfreq(21, .01))
def testFFTFreq(self): t = fftfreq(10, .1, chunk_size=3) self.assertEqual(t.shape, np.fft.fftfreq(10, .1).shape) t.tiles() self.assertEqual(t.shape, tuple(sum(ns) for ns in t.nsplits)) t = rfftfreq(10, .1, chunk_size=3) self.assertEqual(t.shape, np.fft.rfftfreq(10, .1).shape) t.tiles() self.assertEqual(t.shape, tuple(sum(ns) for ns in t.nsplits))
def test_fft_freq(): t = fftfreq(10, .1, chunk_size=3) assert t.shape == np.fft.fftfreq(10, .1).shape t = tile(t) assert t.shape == tuple(sum(ns) for ns in t.nsplits) t = rfftfreq(10, .1, chunk_size=3) assert t.shape == np.fft.rfftfreq(10, .1).shape t = tile(t) assert t.shape == tuple(sum(ns) for ns in t.nsplits)