(self)
| 458 | assert_equal(_mrec._mask.tolist(), mrec._mask.tolist()) |
| 459 | |
| 460 | def test_fromtextfile(self): |
| 461 | # Tests reading from a text file. |
| 462 | fcontent = ( |
| 463 | """# |
| 464 | 'One (S)','Two (I)','Three (F)','Four (M)','Five (-)','Six (C)' |
| 465 | 'strings',1,1.0,'mixed column',,1 |
| 466 | 'with embedded "double quotes"',2,2.0,1.0,,1 |
| 467 | 'strings',3,3.0E5,3,,1 |
| 468 | 'strings',4,-1e-10,,,1 |
| 469 | """) |
| 470 | with temppath() as path: |
| 471 | with open(path, 'w') as f: |
| 472 | f.write(fcontent) |
| 473 | mrectxt = fromtextfile(path, delimiter=',', varnames='ABCDEFG') |
| 474 | assert_(isinstance(mrectxt, MaskedRecords)) |
| 475 | assert_equal(mrectxt.F, [1, 1, 1, 1]) |
| 476 | assert_equal(mrectxt.E._mask, [1, 1, 1, 1]) |
| 477 | assert_equal(mrectxt.C, [1, 2, 3.e+5, -1e-10]) |
| 478 | |
| 479 | def test_addfield(self): |
| 480 | # Tests addfield |
nothing calls this directly
no test coverage detected