From b90f761670d3ff9b31443073b549de3161936f79 Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Sun, 15 Oct 2023 11:29:52 -0400 Subject: [PATCH] change indices to be 1-based --- src/sourmash/commands.py | 2 +- tests/test_sourmash.py | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/sourmash/commands.py b/src/sourmash/commands.py index a1256e08e4..9f30e64ec3 100644 --- a/src/sourmash/commands.py +++ b/src/sourmash/commands.py @@ -281,7 +281,7 @@ def plot(args): sys.exit(-1) elif args.indices: # construct integer labels - labeltext = [str(i) for i in range(D.shape[0])] + labeltext = [str(i + 1) for i in range(D.shape[0])] else: assert not display_labels labeltext = [""] * D.shape[0] diff --git a/tests/test_sourmash.py b/tests/test_sourmash.py index 11d538ad2a..d8c585b3f0 100644 --- a/tests/test_sourmash.py +++ b/tests/test_sourmash.py @@ -979,10 +979,10 @@ def test_plot_6_indices(runtmp): print(runtmp.last_result.out) expected = """\ -0\t0 -1\t1 -2\t2 -3\t3""" +0\t1 +1\t2 +2\t3 +3\t4""" assert expected in runtmp.last_result.out @@ -1000,10 +1000,10 @@ def test_plot_6_no_labels(runtmp): print(runtmp.last_result.out) expected = """\ -0\t0 -1\t1 -2\t2 -3\t3""" +0\t1 +1\t2 +2\t3 +3\t4""" assert expected in runtmp.last_result.out @@ -1021,10 +1021,10 @@ def test_plot_6_no_indices(runtmp): print(runtmp.last_result.out) expected = """\ -0\t0 -1\t1 -2\t2 -3\t3""" +0\t1 +1\t2 +2\t3 +3\t4""" assert expected in runtmp.last_result.out