(self)
| 7842 | assert_array_equal(obj, y2) |
| 7843 | |
| 7844 | def test_roundtrip(self): |
| 7845 | x = np.array([1, 2, 3, 4, 5], dtype='i4') |
| 7846 | self._check_roundtrip(x) |
| 7847 | |
| 7848 | x = np.array([[1, 2], [3, 4]], dtype=np.float64) |
| 7849 | self._check_roundtrip(x) |
| 7850 | |
| 7851 | x = np.zeros((3, 3, 3), dtype=np.float32)[:, 0,:] |
| 7852 | self._check_roundtrip(x) |
| 7853 | |
| 7854 | dt = [('a', 'b'), |
| 7855 | ('b', 'h'), |
| 7856 | ('c', 'i'), |
| 7857 | ('d', 'l'), |
| 7858 | ('dx', 'q'), |
| 7859 | ('e', 'B'), |
| 7860 | ('f', 'H'), |
| 7861 | ('g', 'I'), |
| 7862 | ('h', 'L'), |
| 7863 | ('hx', 'Q'), |
| 7864 | ('i', np.single), |
| 7865 | ('j', np.double), |
| 7866 | ('k', np.longdouble), |
| 7867 | ('ix', np.csingle), |
| 7868 | ('jx', np.cdouble), |
| 7869 | ('kx', np.clongdouble), |
| 7870 | ('l', 'S4'), |
| 7871 | ('m', 'U4'), |
| 7872 | ('n', 'V3'), |
| 7873 | ('o', '?'), |
| 7874 | ('p', np.half), |
| 7875 | ] |
| 7876 | x = np.array( |
| 7877 | [(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 7878 | b'aaaa', 'bbbb', b'xxx', True, 1.0)], |
| 7879 | dtype=dt) |
| 7880 | self._check_roundtrip(x) |
| 7881 | |
| 7882 | x = np.array(([[1, 2], [3, 4]],), dtype=[('a', (int, (2, 2)))]) |
| 7883 | self._check_roundtrip(x) |
| 7884 | |
| 7885 | x = np.array([1, 2, 3], dtype='>i2') |
| 7886 | self._check_roundtrip(x) |
| 7887 | |
| 7888 | x = np.array([1, 2, 3], dtype='<i2') |
| 7889 | self._check_roundtrip(x) |
| 7890 | |
| 7891 | x = np.array([1, 2, 3], dtype='>i4') |
| 7892 | self._check_roundtrip(x) |
| 7893 | |
| 7894 | x = np.array([1, 2, 3], dtype='<i4') |
| 7895 | self._check_roundtrip(x) |
| 7896 | |
| 7897 | # check long long can be represented as non-native |
| 7898 | x = np.array([1, 2, 3], dtype='>q') |
| 7899 | self._check_roundtrip(x) |
| 7900 | |
| 7901 | # Native-only data types can be passed through the buffer interface |
nothing calls this directly
no test coverage detected