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

Method test_changing_singleton

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

Source from the content-addressed store, hash-verified

153 npt.assert_array_almost_equal( locals()['x'], (3.5*y) - y )
154
155 def test_changing_singleton(self):
156 # When a single-valued array is changed (i.e. it should be KIND_ARRAY, not KIND_SCALAR)
157 logger.info( 'Test changing singleton' )
158 pi = np.pi
159 y = np.arange(self.ssize)
160 x = np.empty_like(y)
161 func = ne3.NumExpr( 'x = y*pi' )
162 func( x=x, y=y, pi=pi*2 )
163 npt.assert_array_almost_equal( x, y*np.pi*2 )
164
165 def test_simple_strides(self):
166 # It may make more sense to do strided operations on all functions

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected