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

Method test_var_complex_byteorder

numpy/_core/tests/test_multiarray.py:7282–7288  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7280 assert_almost_equal(res, tgt)
7281
7282 def test_var_complex_byteorder(self):
7283 # Test that var fast-path does not cause failures for complex arrays
7284 # with non-native byteorder
7285 _, cmat, _ = self._create_data()
7286 cmat = cmat.copy().astype('complex128')
7287 cmat_swapped = cmat.astype(cmat.dtype.newbyteorder())
7288 assert_almost_equal(cmat.var(), cmat_swapped.var())
7289
7290 def test_var_axis_error(self):
7291 # Ensure that AxisError is raised instead of IndexError when axis is

Callers

nothing calls this directly

Calls 5

_create_dataMethod · 0.95
assert_almost_equalFunction · 0.90
astypeMethod · 0.80
copyMethod · 0.45
varMethod · 0.45

Tested by

no test coverage detected