Opened 5 years ago

Last modified 4 years ago

#22605 closed defect

Better error handling of the polyhedron constructor for non-embedded NumberField and floats. — at Version 1

Reported by: jipilab Owned by:
Priority: major Milestone: sage-8.1
Component: geometry Keywords: polyhedron, base ring
Cc: moritz, mkoeppe, vdelecroix, novoselt, tmonteil, tscrim Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jipilab)

These error messages are not really informative of what the problem really is:

sage: K = NumberField(x^2-2,'s')
sage: s = K.0
sage: L = NumberField(x^3-2,'t')
sage: t = L.0
sage: P = Polyhedron(vertices = [[0,s],[t,0]])
Traceback (most recent call last):
...
AttributeError: 'Objects_with_category' object has no attribute 'is_exact'

similar problem with floats:

sage: f = float(1.1)
sage: f
1.1
sage: Polyhedron(vertices=[[f]])
Traceback (most recent call last):
...
AttributeError: type object 'float' has no attribute 'is_exact'

The constructor could try to detect the problem and return an informative message.

Change History (1)

comment:1 Changed 5 years ago by jipilab

  • Description modified (diff)
Note: See TracTickets for help on using tickets.