#19163: LatticePoset creation: Empty argument, better error reporting
-------------------------------------+-------------------------------------
Reporter: jmantysalo | Owner:
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-7.1
Component: combinatorics | Resolution:
Keywords: | Merged in:
Authors: Jori Mäntysalo | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jmantysalo/latticeposet_creation__empty_argument__better_error_reporting|
b42c0e7cabca4264e55291ff5e6114d1d00a0a7b
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Jori M\xe4ntysalo', 'oldvalue': ''}):
* cc: jdemeyer (removed)
* status: new => needs_review
* author: => Jori Mäntysalo
* milestone: sage-wishlist => sage-7.1
Old description:
> Because `Poset()` creates the empty poset, I think that `LatticePoset()`
> should create the empty lattice.
>
> Error reporting is irritating. `LatticePoset({'a':['b','c']})` should say
> "no top element" of "no join for 'b' and 'c'" or something similar.
New description:
Before this patch sage outputs only `ValueError: Not a lattice.` from
{{{
LatticePoset({'a':['b', 'c'], 'b': ['d', 'e'], 'c': ['d', 'e'], 'd':
['f'], 'e': ['f']})
}}}
After this it will output `ValueError: Not a lattice: no meet for e and
d.` Same applies to semilattices.
And because `Poset()` returns the empty poset, this changes
`LatticePoset()` to return the empty lattice.
--
Comment:
As I got no comments for custom error class, I did this with string
manipulation.
--
Ticket URL: <http://trac.sagemath.org/ticket/19163#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.