id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
26363,Polyhedron_normaliz.save,Matthias Köppe,,"{{{
sage: P = polytopes.dodecahedron(backend='normaliz')
sage: P
A 3-dimensional polyhedron in (Number Field in sqrt5 with defining polynomial x^2 - 5)^3 defined as the convex hull of 20 vertices
sage: P.save('dodecahedron.sobj')
TypeError: can't pickle PyCapsule objects
}}}
We fix this by removing the cone with `__getstate__` on pickling.
On unpickling we use `__setstate__` and `_cone_from_Vrepresentation_and_Hrepresentation` from #28639 to restore the cone.
Special care has to be taken in the following cases:
- no inequalities (the cone can only be initialized from Vrep),
- the empty polyhedron (cone is `None` in this case).
As the lines are recomputed, there is no guarantee that they appear in the same order in the normaliz cone. However, normaliz sorts the given lines anyway:
{{{
sage: P = Polyhedron(lines=[[1,0], [0,1]], backend='normaliz').lines()
(A line in the direction (1, 0), A line in the direction (0, 1))
sage: P = Polyhedron(lines=[[0,1], [1,0]], backend='normaliz').lines()
(A line in the direction (1, 0), A line in the direction (0, 1))
sage: P = Polyhedron(lines=[[1,1], [1,0]], backend='normaliz').lines()
(A line in the direction (1, 0), A line in the direction (0, 1))
}}}
Also, even if `_normaliz_cone` has the lines somewhat shuffled, this shouldn't be noticable as computations are invariant on which line we choose.",defect,closed,major,sage-9.1,geometry,fixed,,Jean-Philippe Labbé Winfried Bruns Travis Scrimshaw gh-kliem,,Jonathan Kliem,Travis Scrimshaw,N/A,,57beae33ef606c604a22fffabd1cfaa02765e091,,#28639,