MCPcopy Create free account
hub / github.com/numpy/numpy / testZeros

Method testZeros

tools/swig/test/testVector.py:187–193  ·  view source on GitHub ↗

Test zeros function

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

printFunction · 0.85
assert_array_equalMethod · 0.80
zerosFunction · 0.50

Tested by

no test coverage detected