#31820 closed defect (fixed)

Fix pickling of normaliz representation objects

Reported by: gh-kliem Owned by:
Priority: major Milestone: sage-9.4
Component: geometry Keywords: normaliz, pickling
Cc: Jean-Philippe Labbé, Matthias Köppe, Volker Braun Merged in:
Authors: Jonathan Kliem Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: public/31820 (Commits, GitHub, GitLab) Commit: 5e65a5e65dee0d4f9a4d35ac3a081f3ca5adc90a
Dependencies: Stopgaps:

Status badges


The normaliz cone is recreated after loading a saved normaliz polyhedron. Unfortunatly, it is recreated from the representation objects and not from the corresponding vectors. This leads to circular dependencies that are not always successfully resolved:

sage: P = polytopes.cube(backend='normaliz')                                    
sage: v = P.Vrepresentation()[0]                                                
sage: v1 = loads(v.dumps())                                                     
Traceback (most recent call last)
~/Applications/sage/local/lib/python3.8/site-packages/sage/geometry/polyhedron/representation.py in __getitem__(self, i)
     83             2
     84         """
---> 85         return self._vector[i]
     87     def __hash__(self):

AttributeError: 'Vertex' object has no attribute '_vector'

We fix this by initialization of the cone from the vectors instead.

Change History (4)

comment:1 Changed 19 months ago by gh-kliem

Branch: public/31820
Commit: 5e65a5e65dee0d4f9a4d35ac3a081f3ca5adc90a
Keywords: normaliz pickling added
Status: newneeds_review

New commits:

79983a9fix pickling of representation objects with backend normaliz
5e65a5eadd doctest

comment:2 Changed 19 months ago by Matthias Köppe

Reviewers: Matthias Koeppe
Status: needs_reviewpositive_review

comment:3 Changed 19 months ago by gh-kliem

Thank you.

comment:4 Changed 17 months ago by Matthias Köppe

Cc: Volker Braun added
Resolution: fixed
Status: positive_reviewclosed

Apparently this was merged as part of #31821.

Note: See TracTickets for help on using tickets.