On Jan 3, 2008 8:48 PM, Brent Woodruff <[EMAIL PROTECTED]> wrote:
> Robert Miller wrote:
> > Right now, it's there but somewhat hidden. I'm not sure why it's
> > hidden. You can do something like
> >
> > sage: G = graphs.PetersenGraph()
> > sage: G.__get_pos__()
>
> When I first looked at the Sage source I missed this storage of
> position. Is there a standard set of properties you have decided to
> keep? As you can see in LAD's GUI, I have decided to store labels
> (string), weights (float), and colors (int), as well as a positions (num
> array of floats).

I'd say anything but standard. Sage's graphs have evolved as people's
needs have influenced them. The positions are there just to give the
graphs a default layout. You can also associate arbitrary python
objects with vertices and edges in Sage, although again these need a
bit of cleanup (http://trac.sagemath.org/sage_trac/ticket/743). Over
the summer, Emily and I were part of an REU on electrical networks.
Not much code came of this, other than a Kirchoff matrix constructor,
mainly because the NetworkX XGraphs and XDiGraphs together with the
linear algebra in Sage were enough for everyone's purposes. Here is a
quick example of what you can do in Sage:

sage: G = Graph()
sage: G.add_vertices(['strings', 77, ('tuples',9,3), 7.6])
sage: G.add_edges([(77,('tuples',9,3),'edgelabel'),
(77,7.6,EllipticCurve('37a'))])
sage: G.show(layout='circular', edge_labels=True,
partition=[['strings'],[77,('tuples',9,3),7.6]])

As you'll see, the partitions argument doesn't specify which color,
but it does display colorings. You can use the vertex_colors option to
specify which vertices get which colors, however we don't store
colorings at this point.

> I am wondering if we could, for the benefit of both projects, settle on
> a common base class or conventions for interoperability. For that
> matter, it wouldn't be difficult to agree to use XGraph/XDiGraph and
> decorate with a common class. I assume any of you would know better than
> me at this point.

That's what Sage uses, XGraph/XDiGraph. Aric, Emily and I will be at
IPAM in the beginning of February (http://wiki.sagemath.org/days7),
and one of our goals is to try to factor as much as we can upstream to
NetworkX. If you aren't able to make it, you should still involve
yourself via wiki and IRC. Several people in the past have "virtually"
participated in Sage days conferences.

Also, I am CCing sage-devel on this letter, mainly for the following
discussion. For those of you who haven't heard of LAD, here is a link
(http://www.fprimex.com/lad).

> > I don't have any experience with wx widgets yet. One of the big
> > challenges Sage developers have been working on lately is interactive
> > widget like features. The main challenge is the existing notebook
> > structure, which uses web browsers to serve an application. Java seems
> > to be the only option, and until recently we hadn't found much
> > (although jmol has potential). How is your experience with wxPython?
>
> First let me say that I'd be happy to lend my assistance to Sage if you
> all decided to use wxPython for something. Here's my take on it:
>
> LAD is my first full blown wxPython application, however I have
> previously worked on C++ wxWidgets projects. I find that the Python API
> almost exactly matches the C++ API so I am able to be very productive.
> Others might see this similarity as a drawback; perhaps that it is not
> pythonic. The documentation is excellent. Traditionally, wxWidget's weak
> spot has been its Mac support (QT is further along), although with
> wxPython 2.8 the quality and portability of the library has greatly
> improved. It is even included in Mac OS X 10.5. I think only QT/PyQT can
> compete in the long run, but I have a personal distaste for QT's layout
> schemes (spacers instead of sizers) and widgets. For the other side of
> the story, you could check with the VLC folks - they are switching from
> wx to QT.
>
> I have spent a significant amount of time building up a set of best
> practices for myself, so I can't say that the Sage developers would
> initially like wxPython. Additionally, I don't know that Sage users
> wouldn't prefer the web based approach already implemented (ala MapleNet).
>
> Brent W.

-- 
Robert L. Miller
University of Washington
Department of Mathematics
http://www.rlmiller.org/

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to