Skip to content

Commit

Permalink
Merge branch 'main' into improve-partitioning
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed Jan 30, 2025
2 parents 8e8aa0d + 266febd commit a5e4cf2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog

X.Y.Z (DD-MM-YYYY)
------------------
* Use epoch to dintinguish multiple instances of the same dataset (:pr:`54`)
* Use np.logical_or.reduce for generating diffs over more than 2 partitioning arrays (:pr:`53`)
* Improve Missing Column error (:pr:`52`)
* Fix `open_datatree` instructions in the README (:pr:`51`)
Expand Down
4 changes: 3 additions & 1 deletion tests/test_row_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def irregular_ms(tmp_path, request):
@pytest.mark.parametrize("auto_corrs", [True, False])
def test_row_mapping(irregular_ms, na, auto_corrs):
table_factory = TableFactory(Table.from_filename, irregular_ms)
structure_factory = MSv2StructureFactory(table_factory, auto_corrs=auto_corrs)
structure_factory = MSv2StructureFactory(
table_factory, [], "abcdef", auto_corrs=auto_corrs
)
structure = structure_factory()

ddid = table_factory().getcol("DATA_DESC_ID")
Expand Down
15 changes: 14 additions & 1 deletion tests/test_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_baseline_id(na, auto_corrs):


@pytest.mark.parametrize("simmed_ms", [{"name": "proxy.ms"}], indirect=True)
@pytest.mark.parametrize("epoch", ["abcdcefg"])
@pytest.mark.parametrize("epoch", ["abcdef"])
def test_structure_factory(simmed_ms, epoch):
partition_columns = ["FIELD_ID", "DATA_DESC_ID", "OBSERVATION_ID"]
table_factory = TableFactory(Table.from_filename, simmed_ms)
Expand Down Expand Up @@ -85,3 +85,16 @@ def test_table_partitioner():
},
},
)


def test_epoch(simmed_ms):
partition_columns = ["FIELD_ID", "DATA_DESC_ID", "OBSERVATION_ID"]
table_factory = TableFactory(Table.from_filename, simmed_ms)
structure_factory = MSv2StructureFactory(table_factory, partition_columns, "abc")
structure_factory2 = MSv2StructureFactory(table_factory, partition_columns, "abc")

assert structure_factory() is structure_factory2()

structure_factory3 = MSv2StructureFactory(table_factory, partition_columns, "def")

assert structure_factory() is not structure_factory3()

0 comments on commit a5e4cf2

Please sign in to comment.