[SciPy-dev] Re: PlotCanvas

Jochen Küpper jochen at jochen-kuepper.de
Wed Oct 24 23:27:11 CDT 2001

On Wed, 24 Oct 2001 17:19:03 -0400 eric jones wrote:

Eric> The figure() method is actually meant for doing this -- although
Eric> I looked at it and noticed the code was disabled.

Yeah, I messed with that last night as well. Apparently I was a little
sleepy already:( 

Eric> I've enabled it and rewritten a little in the current CVS.

Seen that...

Eric> figure() works very much like Matlab's figure.  

Well, sorry. I think I spent at most 2 hours with matlab, and that is
definitely more than 5 years ago:(

Eric> [...]
Eric> Here figure(a) is equivalent to your setActive(a).

Not exactly. What I really need is to tell plt about a new plot_canvas
it did't create by itself! Well, you could say I have to smuggle it in:)

The way to do that is to extend the "case" in figure() so when
which_object is not numeric and not in _figure to check whether
   type(which_object) == type(<instance of plot_canvas or derived class>)

If I understand that correctly something like that is definitely not
possible in python < 2.2 (and I am not sure it is possible in 2.2).

Well, the attached patch has an even worse hack than all the stuff
before, but it does work along the python lines of cooperation:))

Eric> Please name functions and classes intended for scipy with all
Eric> lower-case/underscore convention (setActive() --> set_active().
Eric> This has been used as uniformly as possible across the entire
Eric> package (although some things are still getting fixed).

Fine. Yes I think consistency is most important here -- it's a huge

One comment from my side: How do you distinguish between classes/types
and functions then? (I don't see real evidence for a verb vs. noun
scheme either...:).

Anyway, there should be something like <scipy>/doc/ProgrammingGuidelines,
I would suggest to start with the second attached file and put all
"enforced" rules in there. Doesn't have to be very formal (yet), just
put in the rules, if they are not clear that *will* be discussed on
the list at some point, you can be sure:(


PS to Eric: Regarding patching: I think if you are on Windows you
should save the patch as DOS-text, not Unix-text? Sorry, I do all this
stuff within Cygwin, I really don't get any work like that done in
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: 44BCCD8E
        Sex, drugs and rock-n-roll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: text/diff
Size: 2727 bytes
Desc: SciPy patch
Url : http://projects.scipy.org/pipermail/scipy-dev/attachments/20011025/c4bcd388/attachment.bin 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ProgrammingGuidelines
Url: http://projects.scipy.org/pipermail/scipy-dev/attachments/20011025/c4bcd388/attachment.ksh 

More information about the Scipy-dev mailing list