[sage-support] Re: graphs(n) behavior under restriction

2008-01-24 Thread kcrisman
All right, extending Robert's patch, I've posted up trac #1908 at: http://sagetrac.org/sage_trac/ticket/1908 This lets you do what you showed above: sage: show([circle((0,0),n) for n in [1..3]]) # three circles (note the extra ] at the end, though). To plot concentric circles, of

[sage-support] Re: graphs(n) behavior under restriction

2008-01-23 Thread Robert Miller
kcrisman, The best possible world might be something like show(graphs(n,size==3)) If you look at http://trac.sagemath.org/sage_trac/ticket/1869 again, you'll see that as of sage 2.10.1 (as long as the patch gets a review before 2.10.1 comes out...), you'll be able to do things like sage:

[sage-support] Re: graphs(n) behavior under restriction

2008-01-23 Thread kcrisman
I'm sorry, I didn't read the ticket on this. This is pretty great - thanks for the work! Amazing what is possible to do. I assume by the fact that you gave the variable that name that it would be possible at some later point to amend the code to allow checking for other extra_property

[sage-support] Re: graphs(n) behavior under restriction

2008-01-23 Thread Jason Grout
kcrisman wrote: I'm sorry, I didn't read the ticket on this. This is pretty great - thanks for the work! Amazing what is possible to do. I assume by the fact that you gave the variable that name that it would be possible at some later point to amend the code to allow checking for other

[sage-support] Re: graphs(n) behavior under restriction

2008-01-23 Thread Jason Grout
Jason Grout wrote: kcrisman wrote: I'm sorry, I didn't read the ticket on this. This is pretty great - thanks for the work! Amazing what is possible to do. I assume by the fact that you gave the variable that name that it would be possible at some later point to amend the code to allow

[sage-support] Re: graphs(n) behavior under restriction

2008-01-20 Thread Robert Miller
Even the syntax of the graphs_list.show_graphs(list) is pretty thorny and certainly nonintuitive compared to the rest of Sage graphics, Can you give an example of what you're talking about? Given any arbitrary list of Sage objects, the only obvious choice I can think of is the

[sage-support] Re: graphs(n) behavior under restriction

2008-01-19 Thread Robert Miller
I should add that the existence of the ability to do sage: for g in graphs(n): : do stuff... was entirely a result of my research. It was just a toy example I did for myself to understand the algorithm, which I intend to use for other purposes. Also, coming very soon will be a linear

[sage-support] Re: graphs(n) behavior under restriction

2008-01-19 Thread Robert Miller
In sage 2.10, if you type sage: graphs? The whole bottom part of the documentation clearly explains how to use the graph iterator. You don't need to dig around in any source for that. I'll add a line at the top that indicates to go down for that... Okay, then I have a different question. Is

[sage-support] Re: graphs(n) behavior under restriction

2008-01-19 Thread kcrisman
The graphs(...) construction is naturally an iterator, so instead of constructing a list, just iterate through them, saving the ones you need. Try this: sage: def check_size(g): : return g.size() == 6 : sage: L = [] sage: for g in graphs(7): : if check_size(g):

[sage-support] Re: graphs(n) behavior under restriction

2008-01-19 Thread William Stein
On Jan 19, 2008 5:48 PM, kcrisman [EMAIL PROTECTED] wrote: The graphs(...) construction is naturally an iterator, so instead of constructing a list, just iterate through them, saving the ones you need. Try this: sage: def check_size(g): : return g.size() == 6 : sage:

[sage-support] Re: graphs(n) behavior under restriction

2008-01-18 Thread kcrisman
Hi Jason - good to hear from you. Hmm, now I'm really stumped. Unfortunately, the online documentation is all messed up - nodes misplaced and everything - and it's only deep within the bowels of graph_generators.py that this information is found. I think this is new since my installation.

[sage-support] Re: graphs(n) behavior under restriction

2008-01-18 Thread Jason Grout
kcrisman wrote: Hi Jason - good to hear from you. Hmm, now I'm really stumped. Unfortunately, the online documentation is all messed up - nodes misplaced and everything - and it's only deep within the bowels of graph_generators.py that this information is found. I think this is new since

[sage-support] Re: graphs(n) behavior under restriction

2008-01-18 Thread kcrisman
I got my information in the previous post from doing sage: graphs? After the (gigantic) list of graphs, it gave the options and documentation for calling graphs(). It wasn't very obvious in the first few pages of documentation that you could call graph directly, though. I think that