MCPcopy Create free account
hub / github.com/pydata/numexpr / test_complex64

Method test_complex64

numexpr3/tests/test_numexpr.py:216–229  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

214 npt.assert_array_equal(ne3.NumExpr('intSize/x')(), intSize/x)
215
216 def test_complex64(self):
217 logger.info( 'Test complex64 ' )
218 def complex64_func(a, b):
219 c = np.zeros(a.shape, dtype='complex64')
220 c.real = a; c.imag = b
221 return c
222
223 a = np.linspace( -1, 1, self.ssize, dtype='float32' )
224 b = np.linspace( -1, 1, self.ssize, dtype='float32' )
225 z = ( a + 1j * b ).astype( 'complex64' )
226 x = z.imag
227 x = np.sin(complex64_func(a,b)).real + z.imag
228 func = ne3.NumExpr('sin(complex(a, b)).real + z.imag')
229 npt.assert_array_almost_equal(x, func())
230
231 def test_complex128(self):
232 logger.info( 'Test complex128' )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected