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

Method testView

tools/swig/test/testArray.py:358–364  ·  view source on GitHub ↗

Test ArrayZ view method

(self)

Source from the content-addressed store, hash-verified

356 self.assertTrue(str(self.array3) == "[ (-2,-4), (-1,-2), (0,0), (1,2), (2,4) ]")
357
358 def testView(self):
359 "Test ArrayZ view method"
360 for i in range(self.array3.length()): self.array3[i] = complex(i+1,i+2)
361 a = self.array3.view()
362 self.assertTrue(isinstance(a, np.ndarray))
363 self.assertTrue(len(a) == self.length)
364 self.assertTrue((a == [1+2j, 2+3j, 3+4j, 4+5j, 5+6j]).all())
365
366######################################################################
367

Callers

nothing calls this directly

Calls 3

lengthMethod · 0.45
viewMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected