Skip to content

Commit ba76664

Browse files
Rename TreeInfo to ArgInfo
1 parent 6042662 commit ba76664

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

sc2ts/debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def label(allele, default=""):
364364
return html + "</table>"
365365

366366

367-
class TreeInfo:
367+
class ArgInfo:
368368
def __init__(
369369
self,
370370
ts,

tests/test_debug.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
@pytest.fixture
1919
def fx_ti_2020_02_13(fx_ts_map):
2020
ts = fx_ts_map["2020-02-13"]
21-
return debug.TreeInfo(ts, show_progress=False)
21+
return debug.ArgInfo(ts, show_progress=False)
2222

2323

2424
@pytest.fixture
2525
def fx_ti_2020_02_15(fx_ts_map):
2626
ts = fx_ts_map["2020-02-15"]
27-
return debug.TreeInfo(ts, show_progress=False)
27+
return debug.ArgInfo(ts, show_progress=False)
2828

2929

3030
@pytest.fixture
@@ -40,7 +40,7 @@ def fx_ts_min_2020_02_15(fx_ts_map):
4040

4141
@pytest.fixture
4242
def fx_ti_recombinant_example_1(fx_recombinant_example_1):
43-
return debug.TreeInfo(fx_recombinant_example_1, show_progress=False)
43+
return debug.ArgInfo(fx_recombinant_example_1, show_progress=False)
4444

4545

4646
def test_get_gene_coordinates():
@@ -62,7 +62,7 @@ def test_copying_table(self, fx_ti_recombinant_example_1):
6262
assert ct_via_ti == ct_via_ts
6363

6464

65-
class TestTreeInfo:
65+
class TestArgInfo:
6666
def test_tree_info_values(self, fx_ti_2020_02_13):
6767
ti = fx_ti_2020_02_13
6868
assert list(ti.nodes_num_missing_sites[:5]) == [0, 0, 121, 693, 667]
@@ -73,7 +73,7 @@ def test_tree_info_values(self, fx_ti_2020_02_13):
7373
"method",
7474
[
7575
func
76-
for (name, func) in inspect.getmembers(debug.TreeInfo)
76+
for (name, func) in inspect.getmembers(debug.ArgInfo)
7777
if name.startswith("plot")
7878
],
7979
)
@@ -206,7 +206,7 @@ def test_recombinants_summary_example_1(self, fx_ti_recombinant_example_1):
206206
assert row2.max_run_length == 0
207207

208208
def test_recombinants_summary_example_2(self, fx_recombinant_example_2):
209-
ti = debug.TreeInfo(fx_recombinant_example_2, show_progress=False)
209+
ti = debug.ArgInfo(fx_recombinant_example_2, show_progress=False)
210210
df = ti.recombinants_summary(characterise_copying=True, show_progress=False)
211211
assert df.shape[0] == 1
212212
row = df.iloc[0]
@@ -237,9 +237,9 @@ def test_recombinants_summary_example_2_bp_shift(self, fx_recombinant_example_2)
237237
md["sc2ts"]["breakpoint_intervals"] = [[114, 29825]]
238238
tables.nodes[sample] = row.replace(metadata=md)
239239
ts = tables.tree_sequence()
240-
ti = debug.TreeInfo(ts, show_progress=False)
240+
ti = debug.ArgInfo(ts, show_progress=False)
241241
df1 = ti.recombinants_summary(characterise_copying=True, show_progress=False)
242-
ti = debug.TreeInfo(fx_recombinant_example_2, show_progress=False)
242+
ti = debug.ArgInfo(fx_recombinant_example_2, show_progress=False)
243243
df2 = ti.recombinants_summary(characterise_copying=True, show_progress=False)
244244
pd.testing.assert_frame_equal(df1, df2)
245245

@@ -253,7 +253,7 @@ def test_recombinants_summary_example_2_bp_shift_past_left(
253253
md["sc2ts"]["breakpoint_intervals"] = [[29827, 29825]]
254254
tables.nodes[sample] = row.replace(metadata=md)
255255
ts = tables.tree_sequence()
256-
ti = debug.TreeInfo(ts, show_progress=False)
256+
ti = debug.ArgInfo(ts, show_progress=False)
257257
df1 = ti.recombinants_summary(show_progress=False)
258258
nt.assert_array_equal(df1.interval_left.values, [29824])
259259
nt.assert_array_equal(df1.interval_right.values, [29825])

tests/test_inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ def test_2020_02_02_deletions_as_missing(
630630
match_db=si.MatchDb.initialise(tmp_path / "match.db"),
631631
deletions_as_missing=deletions_as_missing,
632632
)
633-
ti = debug.TreeInfo(ts, show_progress=False)
633+
ti = debug.ArgInfo(ts, show_progress=False)
634634
expected = 0 if deletions_as_missing else 4
635635
assert np.sum(ti.mutations_derived_state == "-") == expected
636636

0 commit comments

Comments
 (0)