On Nov 29, 2009, at 8:27 AM, Nathann Cohen wrote: > HMmmm... > > I started creating new modules, and I wanted to split it piece by > piece, with time. Ticket #7365 creates a module named > graph_decomposition which I intend to fill ( but I will begin to write > these functions when this patch will be merged and the file > created ). > > Is it possible in Python to create a module containing a function X, > then to write in the body of the graph class "from my_module import X" > so that the X function can be used as any method in the graph class ? > I am asking this question because I thought it was possible, but I was > not able to do it with several functions defined in graph_coloring, > perhaps because of a cyclic dependance. This would enable us to split > this file efficiently, and to avoid having to copy docstrings and > create useless wrappers as it is the case for the moment with > coloring functions.
I think something like this is possible, but it does make it harder to figure out how to navigate the source. Big files are a pain, but so are classes that get split among a dozen small files. > I also created ticket #7369 but it was refused as a blocker and I do > not really know how to produce such a patch without wiping out all the > other modifications. If you know how to write it, plllleaaaaaase tell > me :-) Look up hg copy and hg rename. This works if you patch is merged with the other changes (not just applied on top). The criteria for a blocker is really high (like giving blatantly wrong answers or not starting up). > If I can help you with your book, I'd gladly do it !!! I plan great > things for Graphs in Sage, but these days I am really stuck with > reviews... Just look at the state of this section on the Trac > Server ! If you're having trouble to getting patches reviewed fast enough, one trick is to try to get people to reciprocate after reviewing some of theirs. > Even though, most of this is not really "urgent" for Sage ( short of > the two LP tickets.. I madly need them to be in the standard Sage by > the end of december ) > > and can easily wait. The most important thing > for the graph library, methinks, is to be rewritten efficiently in C > so that I will be able to rewrite the most useful functions from > Python to Cython and speed up the rest of them... > > For the degree sequence, I think g.degree() should do :-) > > Nathann > > -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel-unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org