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

Method testOnes

tools/swig/test/testVector.py:155–161  ·  view source on GitHub ↗

Test ones function

(self)

Source from the content-addressed store, hash-verified

153
154 # Test the (type* INPLACE_ARRAY1, int DIM1) typemap
155 def testOnes(self):
156 "Test ones function"
157 print(self.typeStr, "... ", end=' ', file=sys.stderr)
158 ones = Vector.__dict__[self.typeStr + "Ones"]
159 vector = np.zeros(5, self.typeCode)
160 ones(vector)
161 np.testing.assert_array_equal(vector, np.array([1, 1, 1, 1, 1]))
162
163 # Test the (type* INPLACE_ARRAY1, int DIM1) typemap
164 def testOnesWrongDim(self):

Callers

nothing calls this directly

Calls 3

printFunction · 0.85
assert_array_equalMethod · 0.80
onesFunction · 0.50

Tested by

no test coverage detected