MCPcopy Index your code
hub / github.com/numpy/numpy / testZeros

Method testZeros

tools/swig/test/testVector.py:188–194  ·  view source on GitHub ↗

Test zeros function

(self)

Source from the content-addressed store, hash-verified

186
187 # Test the (int DIM1, type* INPLACE_ARRAY1) typemap
188 def testZeros(self):
189 "Test zeros function"
190 print(self.typeStr, "... ", end=' ', file=sys.stderr)
191 zeros = Vector.__dict__[self.typeStr + "Zeros"]
192 vector = np.ones(5, self.typeCode)
193 zeros(vector)
194 np.testing.assert_array_equal(vector, np.array([0, 0, 0, 0, 0]))
195
196 # Test the (int DIM1, type* INPLACE_ARRAY1) typemap
197 def testZerosWrongDim(self):

Callers

nothing calls this directly

Calls 1

zerosFunction · 0.85

Tested by

no test coverage detected