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

Method test_complex64_alignment

numpy/_core/tests/test_regression.py:2090–2102  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2088 assert_raises(TypeError, np.searchsorted, a, 1)
2089
2090 def test_complex64_alignment(self):
2091 # Issue gh-2668 (trac 2076), segfault on sparc due to misalignment
2092 dtt = np.complex64
2093 arr = np.arange(10, dtype=dtt)
2094 # 2D array
2095 arr2 = np.reshape(arr, (2, 5))
2096 # Fortran write followed by (C or F) read caused bus error
2097 data_str = arr2.tobytes('F')
2098 data_back = np.ndarray(arr2.shape,
2099 arr2.dtype,
2100 buffer=data_str,
2101 order='F')
2102 assert_array_equal(arr2, data_back)
2103
2104 def test_structured_count_nonzero(self):
2105 arr = np.array([0, 1]).astype('i4, 2i4')[:1]

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
reshapeMethod · 0.80
tobytesMethod · 0.45

Tested by

no test coverage detected