Skip to content

Commit

Permalink
Merge pull request #335 from saraedum/idrepr
Browse files Browse the repository at this point in the history
Improving printing of the identical deformation
  • Loading branch information
saraedum committed Jan 10, 2024
2 parents a6e8c3d + c51dcff commit 53fd323
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/news/idrepr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Fixed:**

* Fixed printing of the trivial deformation to actually print as a deformation and not as the underlying surface.
2 changes: 1 addition & 1 deletion libflatsurf/src/trivial_deformation_relation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ bool TrivialDeformationRelation<Surface>::trivial() const {

template <typename Surface>
std::ostream& TrivialDeformationRelation<Surface>::operator>>(std::ostream& os) const {
return os << this->domain;
return os << "Identity on " << this->domain;
}

} // namespace flatsurf
Expand Down
4 changes: 4 additions & 0 deletions pyflatsurf/test/deformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,14 @@ def test_deformation(surface):
domain = surface.clone()
track = cppyy.gbl.flatsurf.Tracked(surface.combinatorial(), cppyy.gbl.flatsurf.Deformation[type(surface)](domain))

assert repr(track).startswith("Identity ")

for edge in surface.edges():
if surface.convex(edge.positive(), True):
surface.flip(edge.positive())

assert not repr(track).startswith("Identity ")

assert track.domain() == domain
assert track.codomain() == surface

Expand Down

0 comments on commit 53fd323

Please sign in to comment.