#18828: Export graph to file
-------------------------+-------------------------------------------------
       Reporter:         |        Owner:
  ncohen                 |       Status:  needs_review
           Type:         |    Milestone:  sage-6.8
  enhancement            |   Resolution:
       Priority:  major  |    Merged in:
      Component:  graph  |    Reviewers:
  theory                 |  Work issues:
       Keywords:         |       Commit:
        Authors:         |  254b36c7132562b01b8802a0f3da49c90f6487d5
  Nathann Cohen          |     Stopgaps:
Report Upstream:  N/A    |
         Branch:         |
  u/dcoudert/18828       |
   Dependencies:         |
-------------------------+-------------------------------------------------
Changes (by dcoudert):

 * commit:  c019634f9a18798786f80c2c3254b2263f58f7d8 =>
     254b36c7132562b01b8802a0f3da49c90f6487d5


Comment:

 I have pushed a small edit on the example. Hope it helps.

 For the unicode problem, I have once used the following trick. Certainly
 not the best way to do it.
 {{{
 import string

 if all(isinstance(u, unicode) for u in G):
     myaction = string.atoi
 elif all(isinstance(u, str) for u in G):
     myaction = ZZ
 else:
     myaction = lambda x:x

 try:
     L = {u:myaction(u) for u in G}
 except:
     L = {u:str(u) for u in G}

 G.relabel(perm=L, inplace=True)
 }}}
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=fed2fd73b9c217218a7dc15cdef487482970271d
 fed2fd7]||{{{trac #18828: Merged with 6.8.beta7}}}||
 
||[http://git.sagemath.org/sage.git/commit/?id=254b36c7132562b01b8802a0f3da49c90f6487d5
 254b36c]||{{{trac #18828: fix and improve test/examples}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/18828#comment:17>
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