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

Class test_zerodim

numexpr3/tests/test_numexpr.py:652–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650
651# Cases for testing arrays with dimensions that can be zero.
652class test_zerodim(unittest.TestCase):
653 def test_zerodim1d(self):
654 logger.info( 'Zerodim 1D' )
655 a0 = np.array([], dtype='int32')
656 a1 = np.array([], dtype='float64')
657
658 r0 = ne3.evaluate('a0 + a1')
659 r1 = ne3.evaluate('a0 * a1')
660
661 npt.assert_array_equal(r0, a1)
662 npt.assert_array_equal(r1, a1)
663
664 def test_zerodim3d(self):
665 logger.info( 'Zerodim 3D' )
666 a0 = np.array([], dtype='int32').reshape(0, 2, 4)
667 a1 = np.array([], dtype='float64').reshape(0, 2, 4)
668
669 r0 = ne3.evaluate('a0 + a1')
670 r1 = ne3.evaluate('a0 * a1')
671
672 npt.assert_array_equal(r0, a1)
673 npt.assert_array_equal(r1, a1)
674
675
676# Tests for threading/multiprocessing/concurrent.futures

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…