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

Method test_complex128

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

Source from the content-addressed store, hash-verified

229 npt.assert_array_almost_equal(x, func())
230
231 def test_complex128(self):
232 logger.info( 'Test complex128' )
233 def complex_func(a, b):
234 c = np.zeros(a.shape, dtype='complex128')
235 c.real = a; c.imag = b
236 return c
237
238 a = np.linspace( -1, 1, self.ssize, dtype='float64' )
239 b = np.linspace( -1, 1, self.ssize, dtype='float64' )
240 z = a + 1j * b
241 x = z.imag
242 x = np.sin(complex_func(a, b)).real + z.imag
243 ne3.NumExpr('y = sin(complex(a, b)).real + z.imag')()
244 npt.assert_array_almost_equal(x, locals()['y'])
245
246
247 def test_complex_strides(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected