MCPcopy Index your code
hub / github.com/numpy/numpy / testView

Method testView

tools/swig/test/testFarray.py:134–144  ·  view source on GitHub ↗

Test Farray view method

(self)

Source from the content-addressed store, hash-verified

132 self.assertTrue(str(self.array) == result)
133
134 def testView(self):
135 "Test Farray view method"
136 for i in range(self.nrows):
137 for j in range(self.ncols):
138 self.array[i, j] = i + j
139 a = self.array.view()
140 self.assertTrue(isinstance(a, np.ndarray))
141 self.assertTrue(a.flags.f_contiguous)
142 for i in range(self.nrows):
143 for j in range(self.ncols):
144 self.assertTrue(a[i, j] == i + j)
145
146######################################################################
147

Callers

nothing calls this directly

Calls 1

viewMethod · 0.45

Tested by

no test coverage detected