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

Method test_magic

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

Source from the content-addressed store, hash-verified

328 npt.assert_array_equal(x, y)
329
330 def test_magic(self):
331 logger.info( 'Test magic output evaluate' )
332 a = np.array([1., 2., 3.])
333 b = np.array([4., 5., 6.])
334 c = np.array([7., 8., 9.])
335 y = 2*a + 3*b*c
336 ne3.evaluate('x_magic=2*a + 3*b*c')
337 # For some reason, only in unittest, does y_magic not appear in the
338 # scope unless explicitely looked for in locals. This works in normal
339 # scripts however.
340 npt.assert_array_equal( locals()['x_magic'], y)
341
342 def test_copy(self):
343 logger.info( 'Test copy evaluate with preallocated output' )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected