Skip to content

Commit 87974d8

Browse files
committed
Notes on testing ignore_tables and TSK_CMP_IGNORE_TABLES
1 parent 66fed18 commit 87974d8

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

c/tests/test_tables.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ test_table_collection_equals_options(void)
277277
CU_ASSERT_FALSE(tsk_table_collection_equals(&tc1, &tc2, 0));
278278
CU_ASSERT_TRUE(tsk_table_collection_equals(&tc1, &tc2, TSK_CMP_IGNORE_METADATA));
279279

280+
// NOTE: test TSK_CMP_IGNORE_TABLES here too?
281+
280282
tsk_table_collection_free(&tc1);
281283
tsk_table_collection_free(&tc2);
282284
}

python/tests/test_highlevel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2278,6 +2278,8 @@ def modify(ts, func):
22782278
assert t1.equals(t2)
22792279
assert t2.equals(t1)
22802280

2281+
# NOTE: test `ignore_tables` here too?
2282+
22812283
def test_tree_node_edges(self):
22822284
for ts in get_example_tree_sequences():
22832285
edge_visited = np.zeros(ts.num_edges, dtype=bool)

python/tests/test_tables.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4003,6 +4003,8 @@ def test_ignore_timestamps(self, t1, t2):
40034003
t1.assert_equals(t2, ignore_provenance=True)
40044004
t1.assert_equals(t2, ignore_timestamps=True)
40054005

4006+
# NOTE: test `ignore_tables` here too?
4007+
40064008

40074009
class TestTableCollectionMethodSignatures:
40084010
tc = msprime.simulate(10, random_seed=1234).dump_tables()

python/tskit/tables.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2856,6 +2856,10 @@ def assert_equals(
28562856
f" differs: self={self.sequence_length} other={other.sequence_length}"
28572857
)
28582858

2859+
# NOTE: Do we need to anything "extra" to account for `ignore_tables`?
2860+
# Currently, the difference between a TableCollection with and without
2861+
# tables gets caught by `AssertionError: EdgeTable number of rows
2862+
# differ:`.
28592863
for table_name, table in self.name_map.items():
28602864
if table_name != "provenances":
28612865
table.assert_equals(

0 commit comments

Comments
 (0)