@@ -3372,7 +3372,7 @@ def test_asdict(self, ts_fixture):
33723372 def test_asdict_force_offset_64 (self , ts_fixture , force_offset_64 ):
33733373 tables = ts_fixture .dump_tables ()
33743374 d = tables .asdict (force_offset_64 = force_offset_64 )
3375- for table in tables .name_map :
3375+ for table in tables .table_name_map :
33763376 for name , column in d [table ].items ():
33773377 if name .endswith ("_offset" ):
33783378 if force_offset_64 :
@@ -3383,7 +3383,7 @@ def test_asdict_force_offset_64(self, ts_fixture, force_offset_64):
33833383 def test_asdict_force_offset_64_default (self , ts_fixture ):
33843384 tables = ts_fixture .dump_tables ()
33853385 d = tables .asdict ()
3386- for table in tables .name_map :
3386+ for table in tables .table_name_map :
33873387 for name , column in d [table ].items ():
33883388 if name .endswith ("_offset" ):
33893389 assert column .dtype == np .uint32
@@ -3423,7 +3423,7 @@ def test_roundtrip_dict(self, ts_fixture):
34233423 t2 = tskit .TableCollection .fromdict (t1 .asdict ())
34243424 t1 .assert_equals (t2 )
34253425
3426- def test_name_map (self , ts_fixture ):
3426+ def test_table_name_map (self , ts_fixture ):
34273427 tables = ts_fixture .tables
34283428 td1 = {
34293429 "individuals" : tables .individuals ,
@@ -3435,13 +3435,18 @@ def test_name_map(self, ts_fixture):
34353435 "migrations" : tables .migrations ,
34363436 "provenances" : tables .provenances ,
34373437 }
3438- td2 = tables .name_map
3438+ td2 = tables .table_name_map
34393439 assert isinstance (td2 , dict )
34403440 assert set (td1 .keys ()) == set (td2 .keys ())
34413441 for name in td2 .keys ():
34423442 assert td1 [name ] == td2 [name ]
34433443 assert td1 == td2
34443444
3445+ # Deprecated in 0.4.1
3446+ with pytest .warns (FutureWarning ):
3447+ td1 = tables .name_map
3448+ td1 == td2
3449+
34453450 def test_equals_empty (self ):
34463451 assert tskit .TableCollection () == tskit .TableCollection ()
34473452
@@ -3943,7 +3948,7 @@ def test_time_units(self, t1, t2):
39433948 ):
39443949 t1 .assert_equals (t2 )
39453950
3946- @pytest .mark .parametrize ("table_name" , tskit .TableCollection (1 ).name_map )
3951+ @pytest .mark .parametrize ("table_name" , tskit .TableCollection (1 ).table_name_map )
39473952 def test_tables (self , t1 , t2 , table_name ):
39483953 table = getattr (t2 , table_name )
39493954 table .truncate (0 )
@@ -3954,7 +3959,7 @@ def test_tables(self, t1, t2, table_name):
39543959 ):
39553960 t1 .assert_equals (t2 )
39563961
3957- @pytest .mark .parametrize ("table_name" , tskit .TableCollection (1 ).name_map )
3962+ @pytest .mark .parametrize ("table_name" , tskit .TableCollection (1 ).table_name_map )
39583963 def test_ignore_metadata (self , t1 , t2 , table_name ):
39593964 table = getattr (t2 , table_name )
39603965 if hasattr (table , "metadata_schema" ):
0 commit comments