本文整理匯總了Python中pyfftw.FFTW.get_input_array方法的典型用法代碼示例。如果您正苦於以下問題:Python FFTW.get_input_array方法的具體用法?Python FFTW.get_input_array怎麽用?Python FFTW.get_input_array使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyfftw.FFTW
的用法示例。
在下文中一共展示了FFTW.get_input_array方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: FFTWMiscTest
# 需要導入模塊: from pyfftw import FFTW [as 別名]
# 或者: from pyfftw.FFTW import get_input_array [as 別名]
#.........這裏部分代碼省略.........
for in_align in alignments:
for out_align in alignments:
expected_align = min(in_align, out_align, max_align)
fft = FFTW(input_arrays[in_align], output_arrays[out_align])
self.assertTrue(fft.input_alignment == expected_align)
self.assertTrue(fft.output_alignment == expected_align)
for update_align in alignments:
if update_align < expected_align:
# This should fail (not aligned properly)
self.assertRaisesRegex(ValueError,
'Invalid input alignment',
fft.update_arrays,
input_arrays[update_align],
output_arrays[out_align])
self.assertRaisesRegex(ValueError,
'Invalid output alignment',
fft.update_arrays,
input_arrays[in_align],
output_arrays[update_align])
else:
# This should work (and not segfault!)
fft.update_arrays(input_arrays[update_align],
output_arrays[out_align])
fft.update_arrays(input_arrays[in_align],
output_arrays[update_align])
fft.execute()
def test_get_input_array(self):
'''Test to see the get_input_array method returns the correct thing
'''
with warnings.catch_warnings(record=True) as w:
# This method is deprecated, so check the deprecation warning
# is raised.
warnings.simplefilter("always")
input_array = self.fft.get_input_array()
self.assertEqual(len(w), 1)
self.assertTrue(issubclass(w[-1].category, DeprecationWarning))
self.assertIs(self.input_array, input_array)
def test_get_output_array(self):
'''Test to see the get_output_array method returns the correct thing
'''
with warnings.catch_warnings(record=True) as w:
# This method is deprecated, so check the deprecation warning
# is raised.
warnings.simplefilter("always")
output_array = self.fft.get_output_array()
self.assertEqual(len(w), 1)
self.assertTrue(issubclass(w[-1].category, DeprecationWarning))
self.assertIs(self.output_array, output_array)
def test_input_array(self):
'''Test to see the input_array property returns the correct thing
'''
self.assertIs(self.input_array, self.fft.input_array)
def test_output_array(self):
'''Test to see the output_array property returns the correct thing