Skip to content

Commit

Permalink
minor tweak on test code
Browse files Browse the repository at this point in the history
  • Loading branch information
tnakazato committed Feb 3, 2025
1 parent 276b173 commit 7825ba7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/ms2_filler/test_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ def test_forest_ms2_structure(msfile):
position = tb.getcell("POSITION", i)
assert position.shape == (3,)
assert np.allclose(position, np.array([-3871023.46, 3428106.87, 3724039.47]))
assert tb.getcell("FLAG_ROW", i) is False

with open_table(os.path.join(msfile, "DATA_DESCRIPTION")) as tb:
assert tb.nrows() == num_spws
for i in range(num_spws):
assert tb.getcell("SPECTRAL_WINDOW_ID", i) == i
assert tb.getcell("POLARIZATION_ID", i) == 0
assert tb.getcell("FLAG_ROW", i) == False
assert tb.getcell("FLAG_ROW", i) is False

with open_table(os.path.join(msfile, "STATE")) as tb:
intents_map = dict((i, v) for i, v in enumerate(tb.getcol("OBS_MODE")))
Expand Down
3 changes: 2 additions & 1 deletion tests/ms2_filler/test_h40.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ def test_h40_ms2_structure(msfile):
position = tb.getcell("POSITION", i)
assert position.shape == (3,)
assert np.allclose(position, np.array([-3871023.46, 3428106.87, 3724039.47]))
assert tb.getcell("FLAG_ROW", i) is False

with open_table(os.path.join(msfile, "DATA_DESCRIPTION")) as tb:
assert tb.nrows() == num_spws
for i in range(num_spws):
assert tb.getcell("SPECTRAL_WINDOW_ID", i) == i
assert tb.getcell("POLARIZATION_ID", i) == 0
assert tb.getcell("FLAG_ROW", i) == False
assert tb.getcell("FLAG_ROW", i) is False

with open_table(os.path.join(msfile, "STATE")) as tb:
intents_map = dict((i, v) for i, v in enumerate(tb.getcol("OBS_MODE")))
Expand Down
3 changes: 2 additions & 1 deletion tests/ms2_filler/test_z45.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ def test_z45_ms2_structure(msfile):
position = tb.getcell("POSITION", i)
assert position.shape == (3,)
assert np.allclose(position, np.array([-3871023.46, 3428106.87, 3724039.47]))
assert tb.getcell("FLAG_ROW", i) is False

with open_table(os.path.join(msfile, "DATA_DESCRIPTION")) as tb:
assert tb.nrows() == num_spws
for i in range(num_spws):
assert tb.getcell("SPECTRAL_WINDOW_ID", i) == i
assert tb.getcell("POLARIZATION_ID", i) == 0
assert tb.getcell("FLAG_ROW", i) == False
assert tb.getcell("FLAG_ROW", i) is False

with open_table(os.path.join(msfile, "STATE")) as tb:
intents_map = dict((i, v) for i, v in enumerate(tb.getcol("OBS_MODE")))
Expand Down

0 comments on commit 7825ba7

Please sign in to comment.