(self)
| 721 | np.lib.npyio._loadtxt_chunksize = self.orig_chunk |
| 722 | |
| 723 | def test_record(self): |
| 724 | c = TextIO() |
| 725 | c.write('1 2\n3 4') |
| 726 | c.seek(0) |
| 727 | x = np.loadtxt(c, dtype=[('x', np.int32), ('y', np.int32)]) |
| 728 | a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')]) |
| 729 | assert_array_equal(x, a) |
| 730 | |
| 731 | d = TextIO() |
| 732 | d.write('M 64 75.0\nF 25 60.0') |
| 733 | d.seek(0) |
| 734 | mydescriptor = {'names': ('gender', 'age', 'weight'), |
| 735 | 'formats': ('S1', 'i4', 'f4')} |
| 736 | b = np.array([('M', 64.0, 75.0), |
| 737 | ('F', 25.0, 60.0)], dtype=mydescriptor) |
| 738 | y = np.loadtxt(d, dtype=mydescriptor) |
| 739 | assert_array_equal(y, b) |
| 740 | |
| 741 | def test_array(self): |
| 742 | c = TextIO() |
nothing calls this directly
no test coverage detected