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

Method test_3

numpy/ma/timer_comparison.py:194–211  ·  view source on GitHub ↗

Tests resize/repeat

(self)

Source from the content-addressed store, hash-verified

192
193 @np.errstate(all='ignore')
194 def test_3(self):
195 """
196 Tests resize/repeat
197
198 """
199 x4 = self.arange(4)
200 x4[2] = self.masked
201 y4 = self.resize(x4, (8,))
202 assert self.allequal(self.concatenate([x4, x4]), y4)
203 assert self.allequal(self.getmask(y4), [0, 0, 1, 0, 0, 0, 1, 0])
204 y5 = self.repeat(x4, (2, 2, 2, 2), axis=0)
205 self.assert_array_equal(y5, [0, 0, 1, 1, 2, 2, 3, 3])
206 y6 = self.repeat(x4, 2, axis=0)
207 assert self.allequal(y5, y6)
208 y7 = x4.repeat((2, 2, 2, 2), axis=0)
209 assert self.allequal(y5, y7)
210 y8 = x4.repeat(2, 0)
211 assert self.allequal(y5, y8)
212
213 @np.errstate(all='ignore')
214 def test_4(self):

Callers

nothing calls this directly

Calls 2

assert_array_equalMethod · 0.95
resizeMethod · 0.45

Tested by

no test coverage detected