MCPcopy
hub / github.com/numpy/numpy / testView

Method testView

tools/swig/test/testArray.py:110–117  ·  view source on GitHub ↗

Test Array1 view method

(self)

Source from the content-addressed store, hash-verified

108 self.assertTrue(str(self.array1) == "[ -2, -1, 0, 1, 2 ]")
109
110 def testView(self):
111 "Test Array1 view method"
112 for i in range(self.array1.length()):
113 self.array1[i] = i + 1
114 a = self.array1.view()
115 self.assertTrue(isinstance(a, np.ndarray))
116 self.assertTrue(len(a) == self.length)
117 self.assertTrue((a == [1, 2, 3, 4, 5]).all())
118
119######################################################################
120

Callers

nothing calls this directly

Calls 3

lengthMethod · 0.80
viewMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected