#18515: LatticePoset: add sublattice()
-------------------------------------+-------------------------------------
       Reporter:  jmantysalo         |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.8
      Component:  combinatorics      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jori Mäntysalo     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/deinst/latticeposet__add_sublattice__|  
47f2ce7a7799982ea29157c932bf91b31b78a3cc
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by deinst):

 * commit:  34a588d1878d613b8e36736a625be1e49d67be77 =>
     47f2ce7a7799982ea29157c932bf91b31b78a3cc


Comment:

 I think there is a typo. I've changed the code to what I think is correct.
 The previous code did the following:
 {{{
 sage: L = Posets.BooleanLattice(3)
 sage: L.sublattice([3,5,6,7])
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)
 <ipython-input-14-837853635c8a> in <module>()
 ----> 1 L.sublattice([Integer(3),Integer(5),Integer(6),Integer(7)])

 /Users/davideinstein/projects/sage/local/lib/python2.7/site-
 packages/sage/combinat/posets/lattices.pyc in sublattice(self, elms)
     881                     elms.append(m)
     882                     n=True
 --> 883         return LatticePoset(self.subposet(elms))
     884
     885
 ############################################################################

 /Users/davideinstein/projects/sage/local/lib/python2.7/site-
 packages/sage/combinat/posets/lattices.pyc in LatticePoset(data, *args,
 **options)
     406     P = Poset(data, *args, **options)
     407     if not P.is_lattice():
 --> 408         raise ValueError("Not a lattice.")
     409
     410     return FiniteLatticePoset(P, category = FiniteLatticePosets(),
 facade = P._is_facade)

 ValueError: Not a lattice.
 }}}

 Also, could you put whitespace around `=` as suggested by
 http://doc.sagemath.org/html/en/developer/coding_basics.html#python-code-
 style
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=47f2ce7a7799982ea29157c932bf91b31b78a3cc
 47f2ce7]||{{{Fixed probable typo}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/18515#comment:5>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to