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

Method test_round_copies

numpy/_core/tests/test_multiarray.py:2240–2251  ·  view source on GitHub ↗
(self, dt)

Source from the content-addressed store, hash-verified

2238
2239 @pytest.mark.parametrize('dt', ['uint8', int, float, complex])
2240 def test_round_copies(self, dt):
2241 a = np.arange(3, dtype=dt)
2242 assert not np.shares_memory(a.round(), a)
2243 assert not np.shares_memory(a.round(decimals=2), a)
2244
2245 out = np.empty(3, dtype=dt)
2246 assert not np.shares_memory(a.round(out=out), a)
2247
2248 a = np.arange(12).astype(dt).reshape(3, 4).T
2249
2250 assert a.flags.f_contiguous
2251 assert np.round(a).flags.f_contiguous
2252
2253 def test_squeeze(self):
2254 a = np.array([[[1], [2], [3]]])

Callers

nothing calls this directly

Calls 3

roundMethod · 0.80
reshapeMethod · 0.80
astypeMethod · 0.80

Tested by

no test coverage detected