Skip to content

Commit

Permalink
Fix identify test.
Browse files Browse the repository at this point in the history
  • Loading branch information
unhyperbolic committed Jul 19, 2023
1 parent 7185c74 commit f734200
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 26 deletions.
26 changes: 1 addition & 25 deletions cython/core/manifold.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1790,31 +1790,7 @@ cdef class Manifold(Triangulation):
free_normal_surfaces(surfaces)
return ans

def identify(self, extends_to_link=False):
"""
Looks for the manifold in all of the SnapPy databases.
For hyperbolic manifolds this is done by searching for isometries:
>>> M = Manifold('m125')
>>> M.identify()
[m125(0,0)(0,0), L13n5885(0,0)(0,0), ooct01_00000(0,0)(0,0)]
By default, there is no restriction on the isometries. One can
require that the isometry take meridians to meridians. This
might return fewer results:
>>> M.identify(extends_to_link=True)
[m125(0,0)(0,0), ooct01_00000(0,0)(0,0)]
For closed manifolds, extends_to_link doesn't make sense
because of how the kernel code works:
>>> C = Manifold("m015(1,2)")
>>> C.identify()
[m006(-5,2)]
>>> C.identify(True)
[]
"""
def _identify(self, extends_to_link=False):
ans = []
for table in database.__all_tables__.values():
match = table.identify(self, extends_to_link)
Expand Down
29 changes: 28 additions & 1 deletion python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,33 @@ class TriangulationHP(_TriangulationHP):
class Manifold(_ManifoldLP):
__doc__ = _ManifoldLP.__doc__

def identify(self, extends_to_link=False):
"""
Looks for the manifold in all of the SnapPy databases.
For hyperbolic manifolds this is done by searching for isometries:
>>> M = Manifold('m125')
>>> M.identify()
[m125(0,0)(0,0), L13n5885(0,0)(0,0), ooct01_00000(0,0)(0,0)]
By default, there is no restriction on the isometries. One can
require that the isometry take meridians to meridians. This
might return fewer results:
>>> M.identify(extends_to_link=True)
[m125(0,0)(0,0), ooct01_00000(0,0)(0,0)]
For closed manifolds, extends_to_link doesn't make sense
because of how the kernel code works:
>>> C = Manifold("m015(1,2)")
>>> C.identify()
[m006(-5,2)]
>>> C.identify(True)
[]
"""
return self._identify(extends_to_link)

def high_precision(self):
"""
Return a high precision version of this manifold.
Expand Down Expand Up @@ -128,7 +155,7 @@ def identify(self, extends_to_link=False):
[]
"""
return self.low_precision().identify(extends_to_link)
return self.low_precision()._identify(extends_to_link)


SnapPy._manifold_class = Manifold
Expand Down

0 comments on commit f734200

Please sign in to comment.