Skip to content

Commit

Permalink
Do not provide CoordinateMapping.__repr__
Browse files Browse the repository at this point in the history
  • Loading branch information
Donaim committed Oct 28, 2024
1 parent e7b5513 commit 0eae4f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/aligntools/coordinate_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})'
12 changes: 6 additions & 6 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 }" \
", " \
Expand Down

0 comments on commit 0eae4f9

Please sign in to comment.