Skip to content

Fix pickling of normaliz representation objects #31820

@kliem

Description

@kliem

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]
     86 
     87     def __hash__(self):

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

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

CC: @jplab @mkoeppe @vbraun

Component: geometry

Keywords: normaliz

Author: Jonathan Kliem

Branch/Commit: public/31820 @ 5e65a5e

Reviewer: Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/31820

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions