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

Method testView

tools/swig/test/testFarray.py:132–142  ·  view source on GitHub ↗

Test Farray view method

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

viewMethod · 0.45

Tested by

no test coverage detected