#15623: Immutable graph backend for Posets
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_work
           Type:         |    Milestone:  sage-6.1
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:         |    Reviewers:
  combinatorics          |  Work issues:  doctest error related with hash
       Keywords:         |  of mutable graphs
        Authors:         |       Commit:
  Nathann Cohen          |  b6ed0387bb16a0102cc2792494d120df7b0fe292
Report Upstream:  N/A    |     Stopgaps:
         Branch:         |
  u/ncohen/15623         |
   Dependencies:         |
  #15622                 |
-------------------------+-------------------------------------------------
Changes (by SimonKing):

 * status:  needs_review => needs_work
 * work_issues:   => doctest error related with hash of mutable graphs


Comment:

 Merging all the dependencies (there are review commits that are not part
 of your branch), I get this error:
 {{{
 sage -t src/sage/combinat/posets/posets.py
 **********************************************************************
 File "src/sage/combinat/posets/posets.py", line 1488, in
 sage.combinat.posets.posets.FinitePoset.to_graph
 Failed example:
     hash(G) == hash(G)
 Exception raised:
     Traceback (most recent call last):
       File "/home/king/Sage/git/sage/local/lib/python2.7/site-
 packages/sage/doctest/forker.py", line 480, in _run
         self.execute(example, compiled, test.globs)
       File "/home/king/Sage/git/sage/local/lib/python2.7/site-
 packages/sage/doctest/forker.py", line 839, in execute
         exec compiled in globs
       File "<doctest
 sage.combinat.posets.posets.FinitePoset.to_graph[4]>", line 1, in <module>
         hash(G) == hash(G)
       File "cachefunc.pyx", line 1790, in
 sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__
 (sage/misc/cachefunc.c:9772)
       File "/home/king/Sage/git/sage/local/lib/python2.7/site-
 packages/sage/graphs/generic_graph.py", line 496, in __hash__
         raise TypeError("This graph is mutable, and thus not hashable. "
     TypeError: This graph is mutable, and thus not hashable. Create an
 immutable copy by `g.copy(data_structure='static_sparse')`
 **********************************************************************
 1 item had failures:
    1 of   6 in sage.combinat.posets.posets.FinitePoset.to_graph
     [837 tests, 1 failure, 11.73 s]
 }}}
 I am wondering: Shouldn't the error message say `g.copy(immutable=False)`?
 What thing did I forgot to merge?

 But in any case, this error needs fixing. I'll see what I can do about it.

--
Ticket URL: <http://trac.sagemath.org/ticket/15623#comment:3>
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/groups/opt_out.

Reply via email to