Skip to content

Removing class argument from ..._from_Triangulation functions. - #157

Merged
unhyperbolic merged 1 commit into
3-manifolds:masterfrom
unhyperbolic:matthias/simplifyFromTriangulation
Oct 26, 2026
Merged

unhyperbolic merged 1 commit into
3-manifolds:masterfrom
unhyperbolic:matthias/simplifyFromTriangulation

Conversation

@unhyperbolic

Copy link
Copy Markdown
Member

No description provided.

@unhyperbolic

Copy link
Copy Markdown
Member Author

Seemed like an obvious simplification - I was wondering whether I am missing something here.

@NathanDunfield NathanDunfield left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any issue with this simplification.

@culler

culler commented Oct 26, 2026

Copy link
Copy Markdown
Member

I think the original intention was to provide a function which can construct a Manifold or a ManifoldHP from a Triangulation. However, currently we provide two such functions, one in the SnapPy extension and one in the SnapPyHP extension. Moreover, they don't work as expected.
The following works:

>>> T = Triangulation('m004')
>>> M = SnapPy.Manifold_from_Triangulation(T, manifold_class=Manifold)
>>> type(M)
<class 'snappy.Manifold'>

But the following does not:

>>> M = SnapPyHP.Manifold_from_Triangulation(T, manifold_class=ManifoldHP)
Traceback (most recent call last):
  File "<python-input-30>", line 1, in <module>
    M = SnapPyHP.Manifold_from_Triangulation(T, manifold_class=ManifoldHP)
TypeError: Argument 'T' has incorrect type (expected SnapPyHP.Triangulation, got Triangulation)

and neither does this:

>>> M = SnapPy.Manifold_from_Triangulation(T, manifold_class=ManifoldHP)
Traceback (most recent call last):
  File "<python-input-31>", line 1, in <module>
    M = SnapPy.Manifold_from_Triangulation(T, manifold_class=ManifoldHP)
  File "src/snappy/extensions/SnapPy/cython_src/core/basic.pyx", line 605, in SnapPy.Manifold_from_Triangulation
TypeError: Cannot convert ManifoldHP to SnapPy.Manifold

One might expect that a Triangulation could be used to construct either a Manifold or a ManifoldHP, but that is not the case.

It is true that one can currently construct a ManifoldHP from a SnapPyHP.Triangulation by passing manifold_class=ManifoldHP to SnapPyHP.Manifold_from_Triangulation.

Will this change make the situation any better?

@unhyperbolic
unhyperbolic merged commit 0912658 into 3-manifolds:master Oct 26, 2026
19 checks passed
@unhyperbolic
unhyperbolic deleted the matthias/simplifyFromTriangulation branch October 26, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants