Opened 10 months ago

Closed 9 months ago

#33666 closed defect (fixed)

Mutable polyhedron (ppl) saves incorrect Vrepresentation

Reported by: gh-kliem Owned by:
Priority: blocker Milestone: sage-9.6
Component: geometry Keywords:
Cc: Matthias Köppe Merged in:
Authors: Jonathan Kliem Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: ed109ae (Commits, GitHub, GitLab) Commit: ed109aea4e7b1a7d334ce64de12542547954d5ed
Dependencies: Stopgaps:

Status badges

Description (last modified by Matthias Köppe)

sage: P = polytopes.cube()
sage: Q = 1/2*P
sage: parent = P.parent()
sage: R = parent._element_constructor_(Q, mutable=True)
sage: R
/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/repl/rich_output/display_manager.py:608: RichReprWarning: Exception in _rich_repr_ while displaying object: no conversion of this rational to integer
  warnings.warn(
The empty polyhedron in ZZ^3
sage: R.Hrepresentation()
(An inequality (0, 0, -2) x + 1 >= 0,
 An inequality (0, -2, 0) x + 1 >= 0,
 An inequality (-2, 0, 0) x + 1 >= 0,
 An inequality (2, 0, 0) x + 1 >= 0,
 An inequality (0, 0, 2) x + 1 >= 0,
 An inequality (0, 2, 0) x + 1 >= 0)
sage: R.Vrepresentation()
[]

While obtaining the Vrepresentation from the backend, a TypeError is not handled properly. We end up with a broken object, which isn't communicated well to the user.

Change History (13)

comment:1 Changed 10 months ago by gh-kliem

Summary: Mutable polyhedron saves incorrect VrepresentationMutable polyhedron (ppl) saves incorrect Vrepresentation

comment:2 Changed 10 months ago by gh-kliem

Status: newneeds_review

comment:3 Changed 10 months ago by gh-kliem

Branch: public/33666
Commit: 1b18639d4bd8ee2a1baa2b335e8f4c02c8b58486

New commits:

1b18639clear cache after catching type error when obtaining Vrepresentation

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

Description: modified (diff)

comment:5 Changed 10 months ago by Matthias Köppe

Status: needs_reviewneeds_work

Patchbot says

sage -t --long --random-seed=33333237385512314714344203620105943909 src/sage/geometry/polyhedron/constructor.py
**********************************************************************
File "src/sage/geometry/polyhedron/constructor.py", line 522, in sage.geometry.polyhedron.constructor.?
Failed example:
    Q = Polyhedron(vertices=[(1, 2, 3), (1, 3, 2), (2, 1, 3),
                             (2, 3, 1), (3, 1, 2), (3, 2, 1)],
                   rays=[[1, 1, 1]], lines=[[1, 2, 3]], backend='ppl',
                   base_ring=ZZ)

comment:6 Changed 10 months ago by git

Commit: 1b18639d4bd8ee2a1baa2b335e8f4c02c8b58486ebe930a5f8d1e32d99854930e72821ce75b21906

Branch pushed to git repo; I updated commit sha1. New commits:

ebe930akeep old type error at initialization

comment:7 Changed 10 months ago by gh-kliem

Status: needs_workneeds_review

comment:8 Changed 10 months ago by git

Commit: ebe930a5f8d1e32d99854930e72821ce75b21906ed109aea4e7b1a7d334ce64de12542547954d5ed

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f635ad1clear cache after catching type error when obtaining Vrepresentation
ed109aekeep old type error at initialization

comment:9 Changed 10 months ago by Matthias Köppe

Reviewers: Matthias Koeppe
Status: needs_reviewpositive_review

comment:10 Changed 10 months ago by gh-kliem

Thank you.

comment:11 Changed 10 months ago by Matthias Köppe

Priority: majorcritical

comment:12 Changed 9 months ago by Matthias Köppe

Priority: criticalblocker

comment:13 Changed 9 months ago by Volker Braun

Branch: public/33666ed109aea4e7b1a7d334ce64de12542547954d5ed
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.