#14105: all_graph_colorings should have an option to use integer colors.
---------------------------------------------------+------------------------
       Reporter:  rowland                          |         Owner:  jason, 
ncohen, rlm
           Type:  enhancement                      |        Status:  needs_info 
       
       Priority:  minor                            |     Milestone:  sage-5.8   
       
      Component:  graph theory                     |    Resolution:             
       
       Keywords:  days45                           |   Work issues:             
       
Report Upstream:  N/A                              |     Reviewers:  Chris Berg 
       
        Authors:  Alejandro Morales, Eric Rowland  |     Merged in:             
       
   Dependencies:                                   |      Stopgaps:             
       
---------------------------------------------------+------------------------

Comment (by ncohen):

 Helloooooooo !!

 > Thanks for the comment. I changed the path so that the default is
 hex_colors = False.

 Yep, but the patch does not pass tests
 {{{
 sage -t  "devel/sage-2/sage/graphs/graph_coloring.py"
 **********************************************************************
 Error: TAB character found.
 **********************************************************************
 File "/home/ncohen/.Sage/devel/sage-2/sage/graphs/graph_coloring.py", line
 151:
     sage: for c in all_graph_colorings(G,2, vertex_color_dict = True):
 Exception raised:
     Traceback (most recent call last):
       File "/home/ncohen/.Sage/local/bin/ncadoctest.py", line 1231, in
 run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File "/home/ncohen/.Sage/local/bin/sagedoctest.py", line 38, in
 run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File "/home/ncohen/.Sage/local/bin/ncadoctest.py", line 1172, in
 run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_1[11]>", line 1
         for c in all_graph_colorings(G,Integer(2), vertex_color_dict =
 True):###line 151:
     sage: for c in all_graph_colorings(G,2, vertex_color_dict = True):
 ^
     SyntaxError: unexpected EOF while parsing
 **********************************************************************
 File "/home/ncohen/.Sage/devel/sage-2/sage/graphs/graph_coloring.py", line
 152:
     sage:      c
 Exception raised:
     Traceback (most recent call last):
       File "/home/ncohen/.Sage/local/bin/ncadoctest.py", line 1231, in
 run_one_test
         self.run_one_example(test, example, filename, compileflags)
       File "/home/ncohen/.Sage/local/bin/sagedoctest.py", line 38, in
 run_one_example
         OrigDocTestRunner.run_one_example(self, test, example, filename,
 compileflags)
       File "/home/ncohen/.Sage/local/bin/ncadoctest.py", line 1172, in
 run_one_example
         compileflags, 1) in test.globs
       File "<doctest __main__.example_1[12]>", line 1
         c###line 152:
     sage:      c
        ^
     IndentationError: unexpected indent
 ...
 ...
 ...
 }}}

 > There is another option count_only=False which returns a generator that
 just returns 1. Shouldn't this just return the number of colorings?

 Indeed ! I guess that the best is to add a counter inside of the function,
 and return the result once all the colorings have been listed.

 Nathann

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14105#comment:6>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to