From 0eae4f91bcf94a7068b3d4a67b4ad5c4ec22006d Mon Sep 17 00:00:00 2001 From: Vitaliy Mysak Date: Mon, 28 Oct 2024 13:45:36 -0700 Subject: [PATCH] Do not provide CoordinateMapping.__repr__ --- src/aligntools/coordinate_mapping.py | 2 +- tests/test_main.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/aligntools/coordinate_mapping.py b/src/aligntools/coordinate_mapping.py index 53f8a2c..8e63f06 100644 --- a/src/aligntools/coordinate_mapping.py +++ b/src/aligntools/coordinate_mapping.py @@ -75,5 +75,5 @@ def __eq__(self, other): return (self.ref_to_op, self.query_to_op) \ == (other.ref_to_op, other.query_to_op) - def __repr__(self): + def __str__(self): return f'CoordinateMapping({self.ref_to_op}, {self.query_to_op})' diff --git a/tests/test_main.py b/tests/test_main.py index 5165e25..96337a3 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1024,7 +1024,7 @@ def test_coordinate_mapping_eq(): assert mapping_1 != mapping_4 -def test_coordinate_mapping_repr(): +def test_coordinate_mapping_str(): mapping_1 = CoordinateMapping() mapping_1.extend(2, 3, 0) mapping_1.extend(3, 4, 1) @@ -1048,17 +1048,17 @@ def test_coordinate_mapping_repr(): mapping_5.extend(4, None, 4) mapping_5.extend(5, 5, 5) - assert repr(mapping_1) \ - == repr(mapping_2) \ + assert str(mapping_1) \ + == str(mapping_2) \ == "CoordinateMapping({ 2: 0, 3: 1 }, { 3: 0, 4: 1 })" - assert repr(mapping_3) \ + assert str(mapping_3) \ == "CoordinateMapping({ 2: 0, 3: 1 }, { 3: 0, 5: 1 })" - assert repr(mapping_4) \ + assert str(mapping_4) \ == "CoordinateMapping({ 2: 1, 3: 2 }, { 3: 1, 4: 2 })" - assert repr(mapping_5) \ + assert str(mapping_5) \ == "CoordinateMapping(" \ "{ 2: 1, 3: 2, 4: 4, 5: 5, None: 3 }" \ ", " \