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

Method test_data_subclassing

numpy/ma/tests/test_subclassing.py:187–195  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

185 self.data = (x, mx)
186
187 def test_data_subclassing(self):
188 # Tests whether the subclass is kept.
189 x = np.arange(5)
190 m = [0, 0, 1, 0, 0]
191 xsub = SubArray(x)
192 xmsub = masked_array(xsub, mask=m)
193 assert_(isinstance(xmsub, MaskedArray))
194 assert_equal(xmsub._data, xsub)
195 assert_(isinstance(xmsub._data, SubArray))
196
197 def test_maskedarray_subclassing(self):
198 # Tests subclassing MaskedArray

Callers

nothing calls this directly

Calls 3

assert_Function · 0.90
assert_equalFunction · 0.90
SubArrayClass · 0.85

Tested by

no test coverage detected