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

Method testFloor

tools/swig/test/testTensor.py:185–193  ·  view source on GitHub ↗

Test floor function

(self)

Source from the content-addressed store, hash-verified

183
184 # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
185 def testFloor(self):
186 "Test floor function"
187 print(self.typeStr, "... ", end=' ', file=sys.stderr)
188 floor = Tensor.__dict__[self.typeStr + "Floor"]
189 tensor = np.array([[[1, 2], [3, 4]],
190 [[5, 6], [7, 8]]], self.typeCode)
191 floor(tensor, 4)
192 np.testing.assert_array_equal(tensor, np.array([[[4, 4], [4, 4]],
193 [[5, 6], [7, 8]]]))
194
195 # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap
196 def testFloorWrongType(self):

Callers

nothing calls this directly

Calls 3

printFunction · 0.85
floorFunction · 0.85
assert_array_equalMethod · 0.80

Tested by

no test coverage detected