(self)
| 738 | _npyio_impl._loadtxt_chunksize = self.orig_chunk |
| 739 | |
| 740 | def test_record(self): |
| 741 | c = TextIO() |
| 742 | c.write('1 2\n3 4') |
| 743 | c.seek(0) |
| 744 | x = np.loadtxt(c, dtype=[('x', np.int32), ('y', np.int32)]) |
| 745 | a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')]) |
| 746 | assert_array_equal(x, a) |
| 747 | |
| 748 | d = TextIO() |
| 749 | d.write('M 64 75.0\nF 25 60.0') |
| 750 | d.seek(0) |
| 751 | mydescriptor = {'names': ('gender', 'age', 'weight'), |
| 752 | 'formats': ('S1', 'i4', 'f4')} |
| 753 | b = np.array([('M', 64.0, 75.0), |
| 754 | ('F', 25.0, 60.0)], dtype=mydescriptor) |
| 755 | y = np.loadtxt(d, dtype=mydescriptor) |
| 756 | assert_array_equal(y, b) |
| 757 | |
| 758 | def test_array(self): |
| 759 | c = TextIO() |
nothing calls this directly
no test coverage detected