Re: [matplotlib-devel] Matplotlib-devel Digest, Vol 29, Issue 19

2008-10-20 Thread Christopher Barker
Ben North wrote:

> I tend to use matplotlib over an X connection,

well, I think that is THE reason to choose wx over wxAgg (or GTK over 
GTKAgg). However, I thought the newer versions of the wx back-end double 
buffered, and thus pretty much eliminated the advantage anyway.

Also note that last I looked into it, wxAgg was doing some extra 
unneeded blitting of the image to the screen, which makes little 
noticeable difference usually. but you might really feel that over an 
remote X connection.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Native backend for Mac OS X

2008-10-28 Thread Christopher Barker
Michiel de Hoon wrote:
> I wrote a backend for matplotlib on Mac OS X. This is a native
> backend for Mac OS X

very nice!

> 4) One drawback compared to the existing cocoa-agg backend is that
> the latter allows easy integration of matplotlib into a larger cocoa
> application, whereas my backend only cares about matplotlib.

well, as far as many of us are concerned, matplotlib IS an embeddable 
plotting package. I suppose you could say that your backend only cares 
about pylab.

Is there any possibility to embed it in another app? I know that wx, for 
instance, can pass a Window handle to other libs, so that you can have 
that window managed and drawn by other code, while wx handles the rest 
of the app -- would this kind of thing be possible with your code with 
wx, and Cocoa, and QT, and ? I imagine GTK would be off the table as it 
is using X11, though I suppose if you are using Apple's X11, it could 
even be possible there.

> Whereas matplotlib has a vastly superior range of high-level plotting
>  capabilities, pygist excelled at sheer speed. This was achieved by 
> having three backends (Windows, Mac OS X, X11) written in C for 
> optimal performance,

I'm still curious where all this speed comes from. MPL already uses Agg 
for a lot, and it's generally reported to be as fast as many native 
drawing APIs (though maybe not quartz?)

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Native backend for Mac OS X

2008-10-29 Thread Christopher Barker
Michiel de Hoon wrote:
> --- On Tue, 10/28/08, Christopher Barker <[EMAIL PROTECTED]>
> wrote:
>> I'm still curious where all this speed comes from.

> At this point, most of it is coming from having complete control over
> the event loop, which allows to avoid superfluous calls to draw().

well, what would be really nice is if we could figure out how to get rid 
of some of this superfluous calls to draw(0 in all the back-ends! I have 
noticed a bunch of extras in wxAgg, but had a hard time untangling it all.

Also, OS-X does double buffer itself, so there may be extra work being 
done there is other back-ends -- essentially triple buffering.

oh well.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] os x egg fubar?

2008-12-16 Thread Christopher Barker
Charlie Moad wrote:
>  Most people
> get a successful install, but then setuptools tries to go out and grab
> the source anyways.  I can't say that I know a good solution for osx.

This may be moot due to what John H. has done, but I thought all you 
need to do to stop setuptools from going and grabbing the source is to 
re-name the egg -- couldn't we just put the same egg up on the website 
with different names for different OS versions?

for instance, I renamed:
matplotlib-0.98.3-py2.5-macosx-10.3.egg

to:
matplotlib-0.98.3-py2.5.egg

and easy_install installed it without a hitch on 10.4

Indeed, that name may work for 10.5 too.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Can we retire numerix?

2009-02-24 Thread Christopher Barker
Eric Firing wrote:
> Why was numerix getting imported?

Good question -- I just figured MPL was doing it!

>  Is this inherent in py2exe--that it 
> imports all subpackages of a base, if you use that base (matplotlib)?

nope -- it imports the regular old python way --just with a different 
sys.path

I'll poke into it a bit more, now that I know it shouldn't be doing it.

> Numerix is there only for the convenience of anyone who has code that 
> depends on it; it is completely unused in matplotlib itself.

That's what I was hoping.

 >  I would be
> happy get it out of matplotlib, or phase it out if necessary.  I don't 
> think it should be left there forever.

I agree.

- Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Can we retire numerix?

2009-02-24 Thread Christopher Barker
Eric Firing wrote:
> It has been purged from the svn trunk.

Thanks. Has it been deprecated somehow? I don't want folks' code to 
break too fast!


>  Now, if you can run your app 
> after building from svn,

Well, I'm not set up to build on Windows...

> it should become obvious where the numerix 
> import was coming from

Found it: it was wxmpl. I'm going to send a patch to Ken.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Selecting WX2.8 in examples

2009-03-09 Thread Christopher Barker
Sandro Tosi wrote:
>>>>>>> import wxversion
>>>>>>> wxversion.select('2.8')
>>>>>>> from wx import *
>>>>>>> wx.__version__
>>>> '2.8.7.1'
>>>>
>>>> That solves the problem of multi-wx on a system.
>>>>
>>>> What do you think about adding those 2 line into wx examples?

hmmm - only the examples? or should it be in the wx back-end itself? 
Maybe at least a version check?

Anyway -- certainly the examples

>>> Moreover, I will provide a patch to move from
>>>
>>>>>> from wx import *
>>> to
>>>>>> import wx

who hoo! thanks!

> AFAIUI, it's not possible to say "2.8+" == "2.8 and all the higher
> versions",

I think there is:

http://www.wxpython.org/docs/api/wxversion-module.html

you need:

import wxversion
wxversion.ensureMinimal('2.8')

I think that will do it, but I haven't tested much -- I only have one 
version installed now. If it does work, I say we definitely ue it in the.

Another option is to put it in the wx back-end in a try block:

wxversion.ensureMinimal('2.4')
Traceback (most recent call last):
   File "", line 1, in 
   File 
"/usr/local/lib/wxPython-unicode-2.8.9.1/lib/python2.5/site-packages/wxversion.py",
 
line 181, in ensureMinimal
 raise AlreadyImportedError("wxversion.ensureMinimal() must be 
called before wxPython is imported")
wxversion.AlreadyImportedError: wxversion.ensureMinimal() must be called 
before wxPython is imported

which might be the safest, and would catch both pylab use, and people's 
home-written apps that need the wxversion call.

thanks for working on this,

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Selecting WX2.8 in examples

2009-03-09 Thread Christopher Barker
Sandro Tosi wrote:

>>>>>> What do you think about adding those 2 line into wx examples?
>> hmmm - only the examples? or should it be in the wx back-end itself?
>> Maybe at least a version check?
> 
> I'll leave this to the mpl gurus...

fair enough.


> yeah, that's what we need: I got 2 version installed (2.6 and 2.8) and
> here is the output

> In [2]: import wxversion
> 
> In [3]: wxversion.ensureMinimal('2.8')
> 
> In [4]: import wx
> 
> In [5]: wx.__version__
> Out[5]: '2.8.7.1'
> 
> So I'm going to use it in the examples. Thanks for spotting it out!

great -- thanks for working on those -- good examples are key!

> I only hope that 2.8->2.10 (or higher) would not introduce such corner
> cases like in 2.6->2.8.

Less likely, with 2.8, we eliminated the compiled parts of the wx 
back-end, by using some new features.

However, if future versions of wxPython get the new enhanced buffer 
interface, it might be nice to use it.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Selecting WX2.8 in examples

2009-03-11 Thread Christopher Barker
Eric Firing wrote:
> I have applied your patch, plus related changes to backend_wx and 
> backend_wxagg as suggested by Chris, to the 0.98.5 maintenance branch, 
> and then used svnmerge to propagate the changes to the trunk.  (In other 
> words, I judged the changes to be a bug fix rather than a new feature.)

Great, thanks! thanks for taking care of us wx users...

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] OpenGL backend and pyglet expertiments

2009-04-04 Thread Christopher Barker

Eric Bruning wrote:
> The idea of a shell with inline plots is a fascinating one -

Then check out reinteract -- very cool:

http://www.reinteract.org/trac/

(though no opengl)

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Cairo Backend and Subpixel Rendering

2009-05-11 Thread Christopher Barker
Jouni K. Seppänen wrote:
> http://en.wikipedia.org/wiki/ClearType

Reading that web page, I'm not convinced MS made the right decision here 
-- on my monitor (which is a ViewSonic LCD, probably pretty standard), 
I'm not sure the ClearType examples really look any better, and they 
certainly could look worse on other displays.

Also from that page:

"""
Additionally, when images are prepared to be display-independent (that 
is, when they are prepared for distribution, and not just for display on 
the computer with which they were prepared), ClearType should be turned 
off if rendered text is part of the image. For example, screenshots 
should always be prepared with ClearType turned off. Image-editing 
programs such as Adobe Photoshop or Corel Paint Shop Pro bypass 
ClearType when rendering text directly, for precisely this reason.
"""

I say just turn it off everywhere, it's the safer bet.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]


--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Cairo Backend and Subpixel Rendering

2009-05-11 Thread Christopher Barker
Freddie Witherden wrote:
> I -- personally -- am not a fan of Microsoft's implementation of  
> subpixel rendering either. I feel that it applies far too heavy  
> hinting to glyphs in order to force them into the pixel grid.

actually, that's a separate issue. the one in that wiki page is taking 
advantage of the fact that a single rgb "pixel" is really three pixels, 
one of each color, and, if you now how those are arranged (and 
apparently they are mostly arranged the same on LCD monitors), you can 
turn on more or less of a color to get a third of the pixel.

> studies have shown that people like what they're used to.

yup. Though I think that MPL is not rendering big blocks of text, the 
there is less "used to" in this case.

> Safari 3 was released for Windows Apple ported their own font  
> rendering engine -- which uses almost no hinting -- provoking many  
> complains from Windows users, who had gotten used to their well hinted  
> glyphs.)

And this is the trick that MS uses to shift glyphs right or left to line 
vertical lines up with the pixel grid. This is nice commentary on a 
bunch of this:

http://www.antigrain.com/research/font_rasterization/

I wonder how the MS tricks do for math -- I'd expect kind of a mess.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Units issue

2009-05-20 Thread Christopher Barker
Ryan May wrote:
> use the units in basic_units.py  (in the examples/units directory).

This looks like pretty cool stuff. However, I can't seem to find 
matplotlib.units or basic_units.py in the online Sphinx docs. Is this a 
doc bug, or intentional?

There are units examples in the docs.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Units issue

2009-05-20 Thread Christopher Barker
Ryan May wrote:
> It's another one of those modules 
> whose docs hasn't been converted to sphinx yet, but it does have doc 
> strings.

Couldn't/shouldn't sphinx just use the docs strings so that there is 
SOMETHING there? I really love the sphinx docs, but it is frustrating 
got have a module simply not listed at all.

> Darren Dale was working on a full-fledged package for adding units to 
> numpy arrays called quantities 
> (http://packages.python.org/quantities/user/tutorial.html),

thanks for the reminder -- that does look like a really nice package. It 
would be great to have a semi-standard for this stuff in the SciPy world 
-- and certainly MPL compatible!

> last I saw it stalled a little due to issues with subclassing ndarray.

Darn. I hope I'll get a chance to delve into it soon.


-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Units issue

2009-05-20 Thread Christopher Barker
John Hunter wrote:
> The use case (and we can debate whether this is worth the extra overhead)
> 
>   ax.plot(inches)
>   ax.set_xlim(cms)

I'll put my two cents into that debate:

My first thought is: wow! that is putting WAY too much into a plotting 
routine!

My second thought is: on the other hand, that is very cool.

If it's going to be done, I think it really shouldn't be too MPL 
specific -- it should be built on a good (and hopefully eventually 
widely used) unit-array system, perhaps like Darren Dale's Quantities 
package (there are quite a few other that should be looked at also).

What that means is that the first step is to get that package complete 
and robust. Using it for this kind of MPL functionality may be a good 
way to put it to the test.

In between, with a good Quantities package, it's not that big a deal to 
put the unit conversion in the hands of user code. The user code would 
simple need to be something like:

ax.plot(values.rescale('cm')
ax.set_xlim(limits.rescale('cm'))

a bit klunkier, but very clear. Explicit is better than implicit...


>   ax.plot(cms)
> 
> the first line would be updated to cm and both would be plotted in cm.

this is a little two implicit for me -- I'd rather specify the units 
explicitly, rather than have the last data added determine it for me.

ax.set_xunit('cm')

I'd probably have it default to the first unit used.


-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Units issue

2009-05-21 Thread Christopher Barker
e still always use float-days- since-epoc for the 
actual numbers. That means that there can be one set of formatters. In 
that example, what units would tofloat() return? If we want formatter to 
work, some info about the units needs to be passed into mpl.

2) in the second version -- every unit-ed data type would have to have a 
tofloat() method (and what units would those floats be in?), or it would be:

ax.plot(mpl.length2num(values.rescale('cm')) )
ax.set_xlim(mpl.length2num(limits.rescale('cm')) )

In the end, I think datetimes are easier, not as many options.

I'm not sure all this was very clear, but hopefully it added some signal 
with the noise!

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Installing matplotlib with Mac OS 10.6

2009-12-03 Thread Christopher Barker
Christopher Barker wrote:

> The diskimage is usually built for the python binary supplied by 
> python.org -- that is what the message means by the "system version". I 
> tried to submit a patch to change that message a year or two ago, but I 
> guess it never got applied -- maybe I'll try again.

I took a look at the source for the latest bdist_mpkg -- it looks like 
it should now give a message like:

"This package requires MacPython to be installed"

though It's all a bit complicated -- did whoever built the dmg use the 
latest bdist_mpkg?

But maybe should still do:

> A note to developers/distributors:
> 
> Robin Dunn figured out a way to install a binary wxPython that will work 
> with both the Apple and the python.org binaries. What it does it put it 
> in /usr/local, and then put a pth file in both of the pythons so that it 
> can be found. A bit of a hack, but it works, and I've never heard anyone 
> have a problem with it.
> 
> Perhaps we should do the same thing with MPL -- I'm sure he'd be glad to 
> share his scripts for building it.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Persistent Matplotlib Figures

2009-12-17 Thread Christopher Barker
Joey Wilson wrote:
> I would like to be able to save the figures from 
> matplotlib in an editable form, without flattening down to an image 
> file. 

> Now, I understand that resources are limited, so I would be willing to 
> raise some money to get this feature added to Matplotlib. 

I think to do this right, you'd need to completely re-design MPL to be 
based on a more declarative structure: i.e. you'd define what the 
objects were in a figure, and MPL would generate the figure from the 
declaration -- much like how an drawing is generated from SVG. Maybe 
it's not as big a re-factor I think it is, but it seems that MPL is 
built to be used from a scripting interface instead: a series of 
commands that builds the figure.

Honestly, for your purposes, I don't know that there is much difference. 
I suppose what you are looking for a is a way to get a script that you 
could edit and re-run, but have it generated from a figure 
automatically, the figure itself could have been generated by a 
different script (intermeshed with computational code), or an 
interactive session, or

That would be pretty cool, but I think a bit of re-factoring of your 
process would make it pretty easy to edit and re-run your scripts anyway.

> I 
> would really like to completely replace Matlab with Python,Scipy, and 
> Matplotlib.

How does Matlab handle this? In my Matlab days, I wrote scripts that 
generated my figures, and when I needed to change them, I edited the 
scripts and re-ran them -- exactly the workflow we're suggesting for 
Python/MPL. But that was 10 years ago...

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Numpy-discussion] Announcing toydist, improving distribution and packaging situation

2009-12-29 Thread Christopher Barker
David Cournapeau wrote:

> Buildout, virtualenv all work by sandboxing from the system python:
> each of them do not see each other, which may be useful for
> development,

And certain kinds of deployment, like web servers or installed tools.

> but as a deployment solution to the casual user who may
> not be familiar with python, it is useless. A scientist who installs
> numpy, scipy, etc... to try things out want to have everything
> available in one python interpreter, and does not want to jump to
> different virtualenvs and whatnot to try different packages.

Absolutely true -- which is why Python desperately needs package version 
selection of some sort. I've been tooting this horn on and off for years 
but never got any interest at all from the core python developers.

I see putting packages in with no version like having non-versioned 
dynamic libraries in a system -- i.e. dll hell. If I have a bunch of 
stuff running just fine with the various package versions I've 
installed, but then I start working on something (maybe just testing, 
maybe something more real) that requires the latest version of a 
package, I have a few choices:
   - install the new package and hope I don't break too much
   - use something like virtualenv, which requires a lot of overhead to 
setup and use (my evidence is personal, despite working with a team that 
uses it, somehow I've never gotten around to using for my dev work, even 
though, in theory, it should be a good solution)
   - setuptools does supposedly support multiple version installs and 
selection, but it's ugly and poorly documented enough that I've never 
figured out how to use it.

This has been addressed with a handful of ad-hock solution: wxPython as 
wxversion.select, and I think PyGTK has something, and who knows what 
else. It would be really nice to have a standard solution available.

Note that the usual response I've gotten is to use py2exe or something 
to distribute, so you're defining the whole stack. That's good for some 
things, but not all (though py2app's "alias" bundles are nice), and 
really pretty worthless for development. Also, many, many packages are a 
  pain to use with py2exe and friends anyway (see my forthcoming other 
long post...)

>  - you cannot use sandboxing as a replacement for backward
> compatibility (that's why I don't care much about all the discussion
> about versioning - I don't think it is very useful as long as python
> itself does not support it natively).

could be -- I'd love to have Python support it natively, though 
wxversion isn't too bad.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Pgfplots (TikZ) backend: implementation strategy

2010-01-12 Thread Christopher Barker
Nico Schlömer wrote:
> I attached a PDF with two figures, one PDF generated and one TikZ
> (generated using my little script). There's clearly a difference in
> how seamless the two figures embed into the document

The only real difference I see is font size. I"d play with that, and 
also play with how you scale the image when you embed it in TeX.

I know when I was putting a bunch of Matlab figures into a big LaTeX doc 
(years ago) , I got the best results by drawing the figures one size, 
then scaling them to fit the LaTeX doc (scaled to \texwidth, or 
something like that).

Also psfrag is great, though I haven't found a pdffrag -- is there one?

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Pgfplots (TikZ) backend: implementation strategy

2010-01-12 Thread Christopher Barker
Nico Schlömer wrote:
> The advantage that I see with TikZ is that the font is *exactly* the
> font used in the surrounding text, no matter the scaling of the axes.

I used to do that with psfrag -- it is a really nice tool. I miss it 
with pdftex. It does add an extra step, but it also supports any PS 
graphics. I wanted it the other day for a diagram I made with INkScape 
(I couldn't get the TeX plugin working...)

Maybe you could port psfrag to pdf instead (my selfish desire...)

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]


--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] An easier way to create figure and group of axes; useful?

2010-02-17 Thread Christopher Barker
Fernando Perez wrote:
> in trying to teach a more structured use of mpl,

good for you!

I always felt that to efficiently use the OO interface, there needed to 
be some more utility functions like this:

> In [37]: figaxes()
> Out[37]:
> (,
>  [])
> 
> In [38]: figaxes((2,1))
> Out[38]:
> (,
>  [,
>   ])
> 
> In [39]: figaxes((2,2),dict(polar=True))
> Out[39]:
> (,
>  [,
>   ,
>   ,
>   ])

I like it!

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs 
proactively, and fine-tune applications for parallel performance. 
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] An easier way to create figure and group of axes; useful?

2010-02-18 Thread Christopher Barker
John Hunter wrote:
> One other thing: I don't think a tuple is best for the axes
> dimensionality.  We always require two and exactly two shape arguments
> (numrows, numcols) so we don't need the flexibility of the tuple in
> the way that numpy.zeros does.  And it is easier to type::
> 
>   fig_subplot(2, 1, sharex=1)
> 
> than::
> 
>   fig_subplot((2,1), sharex=1)

would we want to support:

   fig_subplot( (2,) )

If so, then a tuple has a real advantage. If not, then it doesn't make 
much difference, though I still prefer the tuple, as I can imagine that 
I might define that somewhere else, and it's handy to have it as a 
single object.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Contouring unstructured triangular grids

2010-03-15 Thread Christopher Barker
Ben Axelrod wrote:
> I am a little unclear on what this is and what it is used for. Is
> this to visualize the triangular grid for things like Finite Element Analysis
> (FEM) and Computational Fluid Dynamics (CFD)?

In can be, yes -- though that's really only the part that renders the 
mesh. Contouring on a triangular mesh can be used to visualize data on 
such a mesh, as generated by FE or FV codes, but can also be used to 
contour and visualize data on any arbitrary points -- it's an 
alternative to interpolating to a regular grid before contouring.

Doing the contouring directly on a triangular mesh is more efficient and 
bit more robust, particularly near the bounds of the data.

> What kind of format is the data in?

It would take simple x,y,z vectors for the contouring routines. There is 
some discussion of the API in that thread. I'd like to see a standard 
class that holds a triangular mesh while we're at it -- to make it 
easier to separate the generation of the mesh from the use of the mesh.

 > Are there any standards for this type of thing?

I wish.

There is a netcdf standard for unstructured meshes being developed as we 
speak, primarily for oceanographic model, but that's all I know of -- 
and MPL doesn't (and shouldn't) support netcdf directly anyway.

There are common ways to express a triangular mesh -- ans we should use 
them:

ie. a NX3 array of indexes, where each row in the array is the three 
indexes into the point coordinate array.

some systems also store indexes to the neighbors of each triangle, etc. 
I think that should all be hidden in the mesh class.

 > Do you have some example code or images?

There were some links in that thread. Ian, maybe you should post them again.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Contouring unstructured triangular grids

2010-03-15 Thread Christopher Barker
Ian Thomas wrote:
>  Alternatively, if you want to specify your own
> triangulation instead you can do that using a indices array of shape
> (3, ntri) where ntri is the number of triangles, and indices[:, i]
> defines the indices of the three points that the i-th triangle is
> composed of.

That would be better as (ntri, 3), to be compatible with the usual C 
ordering of numpy arrays.

just a nit,

- Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Contouring unstructured triangular grids

2010-03-15 Thread Christopher Barker
Robert Kern wrote:
> On 2010-03-15 13:30 PM, Ryan May wrote:
>   Are you looking at making it possible to
>> construct a triangulation from the delaunay triangulation that is used
>> by griddata? (Sorry, I didn't follow the thread that closely.)
> 
> He's using matplotlib.delaunay.
> 

right, and the goal is to make it pretty easy to plug in another 
triangulation routine, or a pre-defined triangulation, if you have one.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Contouring unstructured triangular grids

2010-03-15 Thread Christopher Barker
John Hunter wrote:
> It would probably
> be beneficial, but by no means required, to use CXX to expose the C++
> part to python so take a look if you are inclined.

What about Cython -- is any one using Cython in MPL yet?

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] An easier way to create figure and group of axes; useful?

2010-03-18 Thread Christopher Barker
Fernando Perez wrote:
> While chatting today with John, he suggested that a better api for
> this would be to return an *array* of supblots, so that  one could
> index them with a[i,j] for the plot in row i, column j.

That would be nice.

> implemented this already, but before committing it, I have one doubt:
> what to do when nrows==ncols==1, the single subplot case? I'm inclined
> to return only the subplot instead of a one-element array, so that one
> can say
> 
> f, a = fig_subplot()
> a.plot(...)
> 
> instead of having to do
> 
> f, a = fig_subplot()
> a[0].plot(...)
> But this means the return value of the function would be:
> - fig, axis if nr=nc=1
> - fig, axis_array in all other cases.

actually, wouldn't there be three options, essentially:
scalar, 1-d, 2-d

so the second example might be.

f, a = fig_subplot()
a[0,0].plot(...)

Eric Firing wrote:
> The behavior one wants depends on whether one is calling fig_subplot in 
> a program in which the number of subplots could range from 0 to n, or 
> whether the call is being made with the number of subplots hardwired.

good point.


> The latter may be most common, but the former seems like an important 
> use case.  I suggest providing a kwarg, e.g. "squeeze=True" as the 
> default, to eliminate zero-size-dimensions from the array, and False for 
> the case where nrows and/or ncols could be zero but one wants to be able 
> to iterate over the resulting array regardless.

this feels a bit ugly to me as well, though not too bad.

Maybe this is too much magic, but could you look at what was passed in 
to the subplot call:

I don't remember if you are following the figure.add_subplot() api, but:

If nothing, then the user is clearly asking for a single axis.

if (r,c,n) then the user is specifying a 2-d arrangement, even if r and 
c happen to be 1.

I think the only two options should be scalar or 2-d array, it seems a 
bit much to have a 1-d array option as well.

Also, IIUC correctly, Figure.add_subplot always returns a SINGLE axis -- 
you have to call it multiple times to get the whole set. Does this 
version return the whole set?

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] An easier way to create figure and group of axes; useful?

2010-03-18 Thread Christopher Barker
John Hunter wrote:
>> I think the only two options should be scalar or 2-d array, it seems a
>> bit much to have a 1-d array option as well.
> 
> I disagree here -- if you are 2,1 or 1,2 rows x cols, 1D indexing is
> natural.  This is also the most common use case so the most important
> to get right.

OK, but then how do you handle the fact that you might get a 0-d, 1-d or 
2-d result? Eric's "squeeze" flag would result in that. Having squeeze1d 
and squeeze2d flags seems a bit much.

-Chris






-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] An easier way to create figure and group of axes; useful?

2010-03-18 Thread Christopher Barker
Fernando Perez wrote:
> Based on the feedback, I'll finish it tonight with squeeze=True as a
> kwarg, that behaves:
> 
> - if True (default): single axis is returned as a scalar, Nx1 or 1xN
> are returned as numpy 1-d arrays, and only NxM with N>1 and M>1 are
> returned as a 2d array.
> 
> - if False, no squeezing at all is done, the return value is always a
> 2-d array, even if it ends up being 1x1.

Good solution, and thanks for working on this!

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] An easier way to create figure and group of axes; useful?

2010-03-19 Thread Christopher Barker
Fernando Perez wrote:
> I personally think that
> this should be the way to use mpl in general when scripting, and the
> way I want to teach,

+ Inf !

I've wanted to do this for years (make a easier way to do scripting the 
OO way), but I only get around to a tiny fraction of the things I want 
to do.

> For this reason, I think the name should be really
> well chosen, and I'm not convinced fig_subplot is a very good one.

I'll leave the name decisions to you folks, I just wanted to be encouraging!

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Release schedule for version 1.0.1?

2010-10-28 Thread Christopher Barker
On 10/25/10 1:41 PM, Daniel Hyams wrote:
> It doesn't really insist on it right?  There are MATPLOTLIBDIR and
> MPLCONFIGDIR environment variables.

> You can set these env variables within your code, before import of
> matplotlib via os.environment.

I'm glad I've learned about this, and will start doing it with my 
bundled up apps -- but that does seem pretty un-pythonic -- shouldn't it 
be possible to set this sort of thing without resorting to that little 
round trip through environment variables?

Not a big deal, but it feels kludgy.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Release schedule for version 1.0.1?

2010-10-28 Thread Christopher Barker
On 10/28/10 11:50 AM, John Hunter wrote:
> On Thu, Oct 28, 2010 at 1:11 PM, Christopher Barker
>>> You can set these env variables within your code, before import of
>>> matplotlib via os.environment.

> The MPLCONFIGDIR tells mpl where to find the config file.  It's hard
> to read the config, no matter how pythonic it is,  if you don't know
> where it is.

OK -- so that does need to be set as the first part of the process.

>  Once the config file (matplotlibrc) is located  you can
> set the datapath with the  'datapath' parameter so you don't need
> MATPLOTLIBDATA (which is only used if datapath is not set).

So the fontcache will be put/found there? That would solve part of 
Russell's (and my) issue.

> We could use command line args, but mpl is a library and shouldn't
> really be using them...  Arguably we are already doing too much in the
> way of command line args.

I agree -- command line args are not the way to go.

On 10/28/10 12:46 PM, Russell E. Owen wrote:

> It's an interesting question. You can't call a matplotlib function to do
> it because it has to happen before matplotlib is loaded. I suppose there
> could be a configuration package to perform the operation.

I actually like that idea. It could even do a bit more, like have the 
matplotlib.use() function, and who knows how many others.

I've never liked the .matplotlibrc approach -- it makes great sense for 
an interactive environment, but not so much for embedding MPL in other 
apps, for all the reason's Russell has laid out.

If there was a mplconfig module that you could import first, and have 
functions in there where you could set all the defaults the way tyou 
like them, it would be easier to make self-contained MPL apps that 
didn't step on each-others toes.

> * The font cache uses absolute paths.

perhaps that could be fixed -- how are parameters like that stored now? 
If it was an attribute of some object, it could be made a property that 
resolved the path is some nifty way. Or, if there were a mplconfig 
module, it could figure out the absolute path for the font cache at run 
time.

> * Where to put it?
>
> I had hoped to put it in the bundled application itself, so that it
> would be thrown out when the application was thrown out.

I think the official way to do it on OS-X is to put it in 
~/Library/Application Support. However, I don't now how that gets 
cleaned up -- if ever!

> I'd like to avoid generating a new MPLCONFIGDIR directory for every
> version of my application (or every version of matplotlib).

I suppose, like for any application configuration, you'd want a new 
version to check the config, and clean it out if it is for an old 
version (or, even better, update for the new version, but that's a lot 
of work)

> An alternative is to just keep using the default MPLCONFIGDIR
> (~/.matplotlib) and put up with the risk of a matplotlibrc file doing
> bad things. That's my plan for now since I know few users who bother to
> set exotic things in their matplotlibrc files, and my application
> already explicitly set the important settings.

I've gotten away with that as well, but I still don't like it!

Is is possible for MPL to read from one place, but write to another? 
Doesn't that happen already for when MPL first starts up and doesn't 
have anything?

And it sounds like the fontcache and rc file don't NEED to be in teh 
same place -- they probably shouldn't be for this type of use.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] How to decouple non-GUI stuff from the GUI?

2010-11-18 Thread Christopher Barker
On 11/18/10 3:08 PM, John Hunter wrote:
> Yes, installing these GUIs on OSX is a mess, particularly GTK.  I only
> recommend it for the very brave and foolish.

yup -- though wxPython is trivial.

Do make sure you're running the python.org python, though -- that's the 
one most likely to be supported by various binary packages.

>  If you use the enthought
> python distribution for OSX, you should get a working tkagg, qt4agg,
> wxagg and macosx (I think)

I don't know if enthought is worth it for that -- but it sure is if you 
want VTK. Mayavi, and a few other really ugly packages!

As for the wonders of CPAN:

I've never been a perl user, but the issues with packages like 
matplotlib on OS-X are due to compiled code that depends on libraries 
that aren't delivered with the OS, on an OS that can have up to four 
diffferent hardware architectures, and a pretty rapidly changing API (or 
ABI anyway). Oh, and it depends on various GUI toolkits that have those 
same issues.

I can't imagine how a CPAN-like system would help with that at all. 
Installing pure python packages isn't a problem at all.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] How to decouple non-GUI stuff from the GUI?

2010-11-19 Thread Christopher Barker
> In other words, with this simulation in place, one should be able to
> create graphical objects, translate them, scale them, shear them,
> recombine them, split them up, interrogate them, etc., and finally
> save these objects to files, without a window ever popping up.  In
> fact, this code should run perfectly well on a terminal without any
> graphical capabilities at all.

This is exactly what the non-gui back-ends are for (agg in particular).

While it would be nice to be able to do all that with a GUI back-end, 
the point of the GUI is to give you a GUI -- if you don't need one, 
don't use one.

> Incidentally, one of the reasons for my difficulties with using
> matplotlib is 100% conceptual.  I just can't wrap my head around the
> idea of needing to implement a "non-interactive" mode.  (Actually, I
> to call it "non-GUI", since it's perfectly possible to envision an
> interaction that is entirely text-based.)

non-GUI is what the Agg, etc back-ends are for. non-interactive is a 
different concept -- it's specifically a subset of GUI behavior:

"interactive" means that you are typing things interactively at the 
command prompt, and thus want to see changes you make to a figure after 
each change -- exactly the opposite of what you want.

"non-interactive" means that you want to be able to do a number of 
manipulations to a figure, and only show the result of those changes 
when you specifically ask to see them. This is kind of similar to what 
you want, but till really talking about behavior with a GUI back-end.

non-GUI back ends are inherently non-interactive.

I'm not totally sure about how MPL works, but it may need to query teh 
back-end occasinally when doing layout, etc. That may require the GUI 
toolkit to be initialized even before anyactual rendering is done. If 
that's the case, then you simpily never want to use a GUI back-end when 
you don't have/need a GUI (text terminal, web application, batch 
scripts, etc).

-Chris



--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] PATCH: fix libpng URLs for OS X makefile

2010-12-10 Thread Christopher Barker
On 12/9/10 11:57 PM, Ludwig Schwardt wrote:
> This patch reminded me to ask why the builtin libpng, zlib and
> libfreetype on Mac OS 10.5 and later are not used to build Matplotlib,

It may be because we still want to support OS-X 10.4 .

Also, not everyone has X11 installed (or does everyone now?)

I also notice that they are in: MacOSX10.4u.sdk (under X11) -- so maybe 
the static libs in there could be used.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] How to decouple non-GUI stuff from the GUI?

2010-12-14 Thread Christopher Barker
On 12/14/10 11:25 PM, Ludwig Schwardt wrote:
> - The only GUI backends worth building on Mac OS X are TkAgg and the
> native macosx one, in my humble opinion.

wx works just fine on OS-X, though I'm pretty sure it's no longer a 
build-time dependency (no compiled code)

> - I have been successfully using the Apple "system" Python since Mac
> OS 10.5 to run numpy/scipy/matplotlib/ipython and never encountered
> any major build or usage problems. I agree that Mac OS 10.4 and
> earlier needed a Python reinstallation, but do not see why it is
> currently still a strong requirement.

I'm not sure how strong, and I don't know about numpy issues, but there 
are some other key issues:

1) not a native readline
2) Apple has NEVER updated any of their Python installs
3) You can't re-distribute it (py2app)
4) I thought there was a TK issue, but I'm not a TK user.
5) It'll only work on a given OS-X version (i.e. you can't distribute a 
binary that will work on multiple versions of OS-X -- at least not older 
ones)

Anyway, for years, the MacPython community has tried to establish a 
standard for the binaries that people build -- Python on the Mac is 
something of a nightmare, what with Apple's Python, python.org's build, 
fink, macports, etc

The ONLY reasonable versions to build binaries for are the python.org 
builds, unless you want to build a LOT of different binaries. Note that 
Robin Dunn has managed to build wxPython binaries that work on both 
python.org and Apple pythons -- neat trick, that -- but not many people 
seem to want to do that kludge.

> As improved documentation I can contribute (yet another :-)) tutorial
> for building and installing matplotlib and friends on a clean Mac OS
> 10.6 system, with a minimum of downloaded packages and using the
> standard system stuff as far as possible.

That would still be nice -- I'm still not sure if you can count on X11 
being installed, though -- do you know?

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[email protected]

--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] backends

2006-07-10 Thread Christopher Barker
John Hunter wrote:
> I've talked with Eric Jones many times about the desirability
> of sharing a single low-level drawing model, probably based on
> PDF/KIVA, that have backends for PS, SVG, PDF and one raster format
> (eg Agg or Cairo). 

Just as a note, if you have Cairo, you have PS, PDF, SVG, raster, and, 
indeed, native draw-to-the-screen functionality.

They're not all robust and complete, but it's seeing a lot of 
development. A robust, numpy-aware PyCairo would be really nice.

In short, Cairo has essentially the same goals (plus a few more) as 
Kiva, except it's written in C. There's some discussion of using it in 
wxWidgets, and, of course, it's already used in newer GTKs.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] wx-style layout engine for matplotlib: mplsizer

2006-07-31 Thread Christopher Barker
Andrew Straw wrote:
> I was thinking I want an exact a replica of the wx API as possible,

well, I'm a big fan of wx.Sizers, but we all know that they confuses folks.

Given that grid-like layouts are likely to be the most common with MPL, 
maybe just make a GridBagSizer, and forget the rest? All the other 
sizers are just a simplification of that anyway.

just my $0.2

Despite that small suggestion -- very nice work!

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mathtext SoC update

2006-08-02 Thread Christopher Barker
John Hunter wrote:
> the STYX fonts are released

did you mean the STIX fonts?

http://www.stixfonts.org/

>   - here are a set of test fonts: http://some.web.site

Is that really the link?

-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mathtext SoC update

2006-08-02 Thread Christopher Barker
Darren Dale wrote:
> I'm actually very hopeful. It's because the TeX code is so well written and 
> documented that the algorithms can (hopefully) be easily ported to Python. 

Good point. I've never looked deep enough to know how complicated the 
algorithms really are -- and we're not trying to build something that 
will run LaTeX here. Although, It would be very useful to be able to use 
add-on packages -- amsmath, if nothing else.

> The problem I have with TeX is 
> that it has a lot of overhead (it's not meant to be used as a daemon), is not 
> intended to be used as a library (as far as I have been able to discern),

These are key -- and what I've been fantasizing for years is that 
someone will re-write to be used as a library.

> and 
> still requires interpretation once the results are produced

DVI is actually pretty simple -- I don't think that's the hard part of 
the problem.

>  The usetex option, which produces excellent
> results, has been an absolute headache to maintain across platforms.

I'm sure! dependency on an external TeX distribution is not a good 
long-term option.

 > Which other projects did you have in mind?

I've seen a couple that are trying to make a version of TeX that can be 
used as a lib -- with just this kind of thing in mind. How active they 
are, and whether they will get anywhere remains to be seen.

Here's one that doesn't look active:
http://www.metatex.org/

and another: but JAVA? argg!
http://www.extex.org/index.html

That might still be a good site to check out if one is to re-write the 
TeX layout engine in Python...

Even if there aren't any other projects to leverage, while less fun, I 
expect that making a library version of TeX from the existing code base 
would result in a far more robust result.

Another option is to build a stripped down TeX distribution that we 
would deliver with MPL. Also a lot of work, but it could be restricted 
to only a small number of fonts, packages, etc.

Anyway, anything that someone will do (and get paid for!) is fine with me!

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] binary release for numpy 1.0

2006-08-02 Thread Christopher Barker
Darren Dale wrote:
> Travis says that barring the discovery of some issue during the beta period, 
> the C API will not change before numpy-1.1. I think an exe may be necessary 
> as well.

and an OS-X mpkg, if you're set up to do that -- also, we'd need to 
build an mpkg of the numpy you used as well.

I don't know if it's time to do that quite yet though.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] numerix.nan?

2006-08-07 Thread Christopher Barker
Eric Firing wrote:
> I think the following (now in svn) should be OK; it seems to work on 
> Windows, at least in the sense that it doesn't trigger an exception.
> 
> nan = struct.unpack('d', struct.pack('Q', 0x7ff8))[0]

It works on OS-X PPC also. I was wondering about endian issues.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Problems upgrading to mpl 0.87.4

2006-08-15 Thread Christopher Barker
I moved this to the devel list -- that seemed more appropriate.

Stefan van der Walt wrote:
> On Mon, Aug 14, 2006 at 11:12:29AM -0700, Christopher Barker wrote:
>> Another (or additional) option is for both MPL and wx to support
>> the new array interface protocol in numpy.

>> Travis posted a patch to PIL for support a while back, I don't know
>> if it's going to get applied or not, but it's worth looking at.
> 
> Looks like it has been added already.

Very cool. Now we just need MPL and wx to support it...

In the meantime, this note from Robin Dunn on the wxpython-users list:

> wx.Image.SetData makes a copy and gives ownership of the copy to the
> image.  This allows it to work even when the source buffer doesn't
> live as long as the image does.

This is probably how the original wx back-end worked.

> There is also the
> wx.Image.SetDataBuffer method, which will have the wxImage use the
> buffer passed in without making a copy, but if the buffer doesn't
> live as long as the image does it will likely cause a crash.

This would probably be the easiest way to get top performance at the 
moment. If we can make the Agg data a buffer, and somehow do the 
reference counting right so it doesn't get deleted while the wxImage is 
still around (that may not be hard -- the wxImage has to be converted to 
a wxBitmap to be drawn anyway)

Another issue is the data layout of the Agg buffer: is it RGB or RGBA 
(or something else?) wxImage requires 24bit RGB. It can support an alpha 
channel, but as far as I can tell, the alpha data is stored in a 
separate array, rather than as an RGBA array.

I'm poking into the code a bit now, and see:

def _py_convert_agg_to_wx_image(agg, bbox):

 image = wx.EmptyImage(int(agg.width), int(agg.height))
 image.SetData(agg.tostring_rgb())

We might be able to just change that to:
image.SetDataBuffer(agg.tostring_rgb())

Does the agg.tostring_rgb() call make a copy?

If so, then maybe a agg.Getbuffer() method is in order.

Also, if it does, then that string will get garbage collected right 
away, and delete the memory buffer. We'd need to keep that around 
somehow. maybe a subclass of wx.Image that holds a reference to the 
string. Then they'll both get deleted when the wx.Image is deleted..

I also took a look at:

def _clipped_image_as_bitmap(

This is way too ugly!

1) maybe it would be a good idea to have a:

agg.subImageToString_rgb(x,y,w,h)

This must be used in all the back-ends

2) If you do need to do the sub-sampling with wx code, I think you could do:

def _clipped_image_as_bitmap(image, bbox):
 """
 Convert the region of a wx.Image described by bbox to a wx.Bitmap.
 """
 l, b, width, height = bbox.get_bounds()
 r = l + width
 t = b + height

 subImage = image.GetSubImage( wx.Rect( (l,b),(width,height) ) )
 destBmp = wx.BitmapFromImage(subImage)

 return destBmp

Much simpler (and probably faster)

3) Another option would be to use numpy arrays to pass this kind of data 
around. We could then use numpy to sub-sample the image. MPL depends on 
numpy anyway, so it's not an added dependency. That may have to wait 
until the 'grand unification" is complete, and we can drop support for 
Numeric and numarray.

Sorry I don't have time to build and test this code right now.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Problems upgrading to mpl 0.87.4

2006-08-17 Thread Christopher Barker
Hi all,

I seem to be talking to myself here, but if someone (including myself) 
wants to pick this up in the future, it'll be good to have it in the 
archives.

Christopher Barker wrote:
>> There is also the
>> wx.Image.SetDataBuffer method, which will have the wxImage use the
>> buffer passed in without making a copy, but if the buffer doesn't
>> live as long as the image does it will likely cause a crash.
> 
> This would probably be the easiest way to get top performance at the 
> moment. If we can make the Agg data a buffer, and somehow do the 
> reference counting right so it doesn't get deleted while the wxImage is 
> still around (that may not be hard -- the wxImage has to be converted to 
> a wxBitmap to be drawn anyway)

I've been suing this for another use, and Robin just added an improved 
version of new wx.Image factory function I wrote for just this purpose:

def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
 """
 Creates a `wx.Image` from the data in dataBuffer.  The dataBuffer
 parameter must be a Python object that implements the buffer
 interface, such as a string, array, etc.  The dataBuffer object is
 expected to contain a series of RGB bytes and be width*height*3
 bytes long.  A buffer object can optionally be supplied for the
 image's alpha channel data, and it is expected to be width*height
 bytes long.

 A reference to the data and alpha buffer objects are kept with the
 wx.Image, so that they won't get deleted until after the wx.Image
 is deleted.  However please be aware that it is not guaranteed that
 an object won't move its memory buffer to a new location when it
 needs to resize its contents.  If that happens then the wx.Image
 will end up referring to an invalid memory location and could cause
 the application to crash.  Therefore care should be taken to not
 manipulate the objects used for the data and alpha buffers in a
 way that would cause them to change size.
 """
 image = wx.EmptyImage(width, height)
 image.SetDataBuffer(dataBuffer)
 if alphaBuffer is not None:
 image.SetAlphaBuffer(alphaBuffer)
 image._buffer = dataBuffer
 image._alpha = alphaBuffer
 return image

Does the aggDrawer already implement a Python buffer object? If so, 
using this would be easy. If not, then it probably should, unless we go 
straight to the numpy array protocol.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Problems upgrading to mpl 0.87.4

2006-08-17 Thread Christopher Barker
Darren Dale wrote:
> I think all the high rollers are at SciPy 2006.

Oh right. This is the third year in a row that I have ALMOST gone 
myself. Maybe next year.

But what's the deal? Aren't they all hooked up to wifi and checking 
email constantly?

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Problems upgrading to mpl 0.87.4

2006-08-17 Thread Christopher Barker
Charlie Moad wrote:
> I'll paste the block of interest to save
> you a little digging.
> 
>bbox = self.replot
>w, h = int(bbox.width()), int(bbox.height())
>l, t = bbox.ll().x().get(), bbox.ur().y().get()
>reg = self.copy_from_bbox(bbox)

So this is one copy.
>stringBuffer = reg.to_string()

Is this another? or does to_string not copy?

>qImage = qt.QImage(stringBuffer, w, h, 32, None, 0,
> qt.QImage.IgnoreEndian)

Here we have difference from wx -- AFAICT, a wx.Image doesn't do rgba32, 
it does RGB24, with a separate 8bit alpha channel. if to_string copies 
anyway, then that wouldn't make much difference.

But do we really need alpha here anyway?

>self.pixmap.convertFromImage(qImage, qt.QPixmap.Color)
>p.drawPixmap(qt.QPoint(l, self.renderer.height-t), self.pixmap)

And this looks like wx.

I wish I had more time to work on this, but I'm in a crunch that I'll be 
in for while

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] [Fwd: [wxPython-users] Re: using wxImage in C++ python extension]

2006-08-18 Thread Christopher Barker
As a probably final installment in the thread about optimizing the wx 
back-end, here is a post from the wxPython list, in which someone posted 
SWIG code for making a PyBuffer from his data set, then using it to 
create a wx.Image without copying. A similar approach could be used for 
the wxAgg back-end.

-Chris

 Original Message 
Subject: [wxPython-users]  Re: using wxImage in C++ python extension
Date: Fri, 18 Aug 2006 16:48:08 + (UTC)
From: Andrew Murray <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
References: <[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]> 
<[EMAIL PROTECTED]>

Hi all :)

I've followed the combined advice of Robin and Christopher in using a python
buffer object to instance a wx.Image in the python wrapper layer.  It 
all seems
to be working - and I don't think there are any 'data copies' going on ;)

To keep my underlying C++ python-free, I introduced the buffer (and 
creation of
the wx.Image) via my .i Swig file.  In case anyone who is reading is 
keen trying
to solve a similar problem, I've included the code that I added to my .i 
file in
order to implement the change below. (I'd appreciate any comments regarding
errors or shortcomings that anyone spots in my implementation.)

Sorry I didn't reply to the thread earlier.  A combination of being tied 
up with
more boring work, moving house and background research into using python 
buffers
with Swig means that I've only just got this far.

One remaining question I have is: Does the call to wx.EmptyImage that I make
cause any memory to be allocated?  I see from Robin's recent post that in my
case this call is now redundant (as I will soon be using 
ImageFromBuffer) - but
I'm curious to know the answer anyway ;)

Thanks for all the help.  The more I use wxPython the more I like it...

Andrew ;)


/* the RawImage C++ class that we are wrapping offers a method that
returns a pointer to an internal 'unsigned char' buffer of display
data.  To make the python class generated by SWIG a bit more
friendly to the rest of our wxPython code we instruct SWIG to make
two modifications during the wrapping process.  First we add a
method to the C++ class that will return a version of the internal
display buffer wrapped up as a 'python buffer object' (performing
this in the C++ wrapper class keeps the wrapped C++ python-free)...
  */
%extend RawImage {
PyObject* RawImage::getDisplayBuffer(void) {
// return a new 'python buffer object' that intialised using
// the memory address and length of our display buffer...
void* pvBufferData = (void*)self->pcGetDisplayData();
int iBufferSize = self->getDisplayBufferSize();
return PyBuffer_FromMemory(pvBufferData, iBufferSize);
}
}
/* ... we also add a method to the python wrapper class that will use
the buffer offered by our new C++ method to create a wx.Image
(neither of these methods actually copies the image data)...
  */
%extend RawImage {
%pythoncode %{
def getImage(self):
 # create an unintialised wx.Image of the correct size...
 wximage = wx.EmptyImage(self.getWidth(), self.getHeight(), clear=False)
 # then define the data content of the image...
 wximage.SetDataBuffer(self.getDisplayBuffer())
 return wximage
%}
}


---------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Fwd: [wxPython-users] Re: using wxImage in C++ python extension]

2006-08-28 Thread Christopher Barker
Ken McIvor wrote:
> I'll put it on the list of things to look into.

Great. I'm glad someone is working on this.

> The problem I foresee is that the Agg renderer's RGBA data has to 
> be converted to RGB before a wxImage can be created by convert_agg2image().

darn. I figured as much. wx is really due for an update to support alpha 
properly. But I guess you'll always have problems with different data 
formats.

 > I'm not sure this approach will help speed
 > up the wxAgg accelerator, but

Anyway, this thread started because people were having binary 
compatibility issues. Even if this doesn't speed up the accelerator, it 
may be possible to get the same performance without using 
wx-version-specific compiled code -- i.e. pure python.

I do have one question -- does the agg back-end really need to use an 
alpha channel for it's buffer? Isn't it the whole image anyway? What is 
is it going to get blended with?

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Fwd: [wxPython-users] Re: using wxImage in C++ python extension]

2006-08-28 Thread Christopher Barker
Ken McIvor wrote:
> The problem I foresee is that the Agg renderer's RGBA data has to 
> be converted to RGB before a wxImage can be created by convert_agg2image().

As if by magic, this from Robin Dunn today:
> You may want to take a look at my CVS commits for the last couple weeks.  
> I've now got some raw bitmap access code in place.  Both 2.6 and 2.7 will 
> have wx.BitmapFromBuffer and wx.BitmapFromBufferRGBA factory functions which 
> can copy from a buffer object directly into the bitmap's pixel buffer, and 
> 2.7 will also have wx.NativePixelData and wx.AlphaPixelData which allow 
> direct access to the pixel buffer from Python.  (The latter needed a bug fix 
> that I'm not sure (yet) can be backported to 2.6...)  For example, I can now 
> do this (in a PyShell):
> 
>  >>> import wx
>  >>> import numarray
>  >>> f = wx.Frame(None)
>  >>> p = wx.Panel(f)
>  >>> dc = wx.ClientDC(p)
>  >>> f.Show()
>  >>> dim=100
>  >>> R=0; G=1; B=2; A=3
>  >>> arr = numarray.array(shape=(dim, dim, 4), typecode='u1')
>  >>> for row in xrange(dim):
>  ... for col in xrange(dim):
>  ...arr[row,col,R] = 0
>  ...arr[row,col,G] = 0
>  ...arr[row,col,B] = 255
>  ...arr[row,col,A] = int(col * 255.0 / dim)
>  ...
>  >>> bmp = wx.BitmapFromBufferRGBA(dim, dim, arr)
>  >>> dc.DrawBitmap(bmp, 20, 20, True)

This is looking pretty promising.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Fwd: [wxPython-users] Re: using wxImage in C++ python extension]

2006-08-31 Thread Christopher Barker
Ken McIvor wrote:
> I think they added preliminary support for alpha channels in 2.5, in the 
> form of wx.Image.HasAlpha().

right, but it uses the old 24 bit RGB buffer, and separate Alpha buffer, 
it's kind of tacked on, rather than native.

 > My beef is that you have to convert
> everything to a wx.Bitmap before you can do anything useful with it.

And that DCs don't support alpha, even though the underlying device 
often does. This has been discuses a lot, but no one has done much about 
it yet -- wxTNG will have something better, but who knows how far out 
that is?

> As near as I can tell, the primary slowdown at this point is the way 
> wxWidgets distinguishes from RGB image data (wx.Image) as opposed to 
> displayed image data (wx.Bitmap).  Right now you cannot draw a wx.Image 
> without first converting it into a wx.Bitmap, nor can you use a MemoryDC 
> to blit or otherwise munge a wx.Image directly.  My impression is that 
> this made sense when wxWindows was getting started (Win16 and Motif), 
> but is more of an artificial distinction at this point.

a wxBitmap is the same format as the native rendering system. While most 
systems use 24b RGB (or 32b RGBA), people can still run displays at 
16bpp or whatever, so it's still needed. Also, I wouldn't be surprised 
if some less common systems use ARGB or something else weird.

> I don't think we're going to be able to get performance similar to that 
> of the accelerator using straight Python code

But whether it's Python or C++, you still need to do the Image->Bitmap 
conversion -- so if we can get rid of the data copying from Agg buffer 
to wxImage in Python, we don't need C++.

> unless something changes 
> in the wxWidgets' Image/Bitmap/MemoryDC department.

And it has. For wxPython 2.7 (and now in CVS) there are methods for 
dumping 32 bit RGBA data directly into a wxBitmap with no copying, if 
the data source is a Python Buffer object. I think I posted a note about 
this here yesterday.

> I'd love to be proven wrong!  If you're interested in the gory details, 
> you should check out the pure-Python implementation of the image 
> conversion functions, at the end of `backend_wxagg.py'.

I did, and I suggested some improvements a couple messages back. To 
really get it to work, the 24bit RGB Agg buffer needs to be a Python 
Buffer object -- is it now? I'm sorry I don't have the time to mess with 
this now -- maybe some day.

>> I do have one question -- does the agg back-end really need to use an 
>> alpha channel for it's buffer? Isn't it the whole image anyway? What 
>> is is it going to get blended with?
> 
> I don't know enough about Agg to venture an educated guess.  My 
> un-educated guess is that there's an RGBA buffer to support alpha in the 
> drawing operations... how can Agg alpha-composite new pixels into the 
> buffer when you draw something, unless you know the alpha values of the 
> existing pixels?

You can alpha composite into a non-alpha background. You just lose the 
alpha there, so that the background couldn't be alpha-composited onto 
anything else -- but does it ever need to be?

However, there is something to be said for just using alpha everywhere, 
and as we'll soon be able to dump RGBA data straight into a wx.Bitmap, 
this should work great.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Fwd: [wxPython-users] Re: using wxImage in C++ python extension]

2006-08-31 Thread Christopher Barker
John Hunter wrote:
> It is useful to store the final pixel buffer (eg in a PNG) as RGBA 
> because some people like to have some parts of their figure 
> transparent to composite the figure with other images.

fair enough, and that's probably a really cool feature when you need it!

ken wrote:

> I was talking about the image-from-a-buffer business not helping us
> with WX 2.4/2.6 due to the RGBA to RGB conversion.

But it looks like RendererAgg has this a agg.tostring_rgb() method, so 
we should be able to do change :

image.SetData(agg.tostring_rgb())

to

image.SetDataBuffer(agg.tostring_rgb())

If we make sure to keepthe string around. I haven't looked at your C++ 
code, but does it do something faster than RendererAgg.tostring_rgb() ?

Another thing that would be nice (for all Agg back-ends, I imagine), is 
if we could replace this:

 # agg => rgb -> image => bitmap => clipped bitmap => image
 return wx.ImageFromBitmap(_clipped_image_as_bitmap(image, bbox))

with a RendererAgg._clipped_tostring_rgb(bbox)

So that we don't copy a bunch of RGB data we don't need.

even if we don't do that, I think

_clipped_image_as_bitmap()

could use wx.Image.GetSubImage(), rather than creating a bimtp of the 
whole thing and blitting. untested code:

def _clipped_image_as_bitmap(image, bbox):
 """
 Convert the region of a wx.Image described by bbox to a wx.Bitmap.
 """
 l, b, width, height = bbox.get_bounds()

 return wx.BitmapFromImage(image.GetSubImage(wxRect((l,b),(w,h


 > RendererAgg appears to already have a buffer_rgba() method.

So we're all set for wxPython 2.7 -- very nice! I hope it doesn't make a 
copy.

Is there a numpy_array_rgba method -- that could be nice, and would work 
as a buffer, too. Maybe when we are ready to dump Numeric and numarray.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] 87.5 binary for os-x

2006-09-12 Thread Christopher Barker
Charlie Moad wrote:
> I've been busy, but I will try to make mpkgs for mpl and numpy tonight
> and post them to the pythonmac-sig list so they get added to the
> pythonmac listing.

In the meantime, why not just post the eggs there? That's probably the 
way of the future anyway.

And for the OP: Charlie has put eggs for OS-X that work for a t least a 
few of us here:

http://euclid.uits.iupui.edu/mplfiles/

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] example: wx.ToolTip for MPL axes

2006-09-14 Thread Christopher Barker
Martin Spacek wrote:
> That initial tooltip never shows up for me, which I think is the correct 
> behaviour,

Probably. You have that Enable(False) call in there. However, I notice 
from the docs that wx.ToolTip.Enable() is a "global" call -- it doesn't 
just enable or disable that particular tooltip. I can't say I really 
understand what that means, though.

> so I just put whatever in there to make it a really long line 
> to get around the wx bug.

Well, it seems to work OK for all the next tips.

> Cool. Yeah, I don't think wx gets as much testing on GTK as it does on 
> Windows.

I think it does. I think GTK and MSW get about equal usage, with wxMac a 
very distant third.

(and this is working very poorly on Mac)

Some things work better on Windows, some on GTK. In this case, I thihk 
we're bumping into cross-platfrom issues. wx tries to use native 
functionality where it can and that does make for differences.

I'm going to take this discussion over to wxpython-users -- are you on 
that list too?

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] ginput in pylab

2006-10-30 Thread Christopher Barker
Gael Varoquaux wrote:
> I think that for such a blocking call to work, all we would need is a
> way to start and stop the eventloop (I am talking in wx terms, the only
> GUI toolkit I know).

That's a trick, because if you stop the event loop, then you don't get 
the mouse clicks...

However, perhaps you can take advantage of a similar feature (at least 
in wx) -- can you make the Frame Modal temporarily? My understanding of 
how model dialogs work is that they stop the main event loop, and then 
have their own event loop, for just that frame -- then you could catch 
the mouse event you want, and make it non-modal again.

What I don't know is if you can make a Frame model/non-model without 
hiding and showing it in the process...

I also don't know if other toolkits work similarly.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Numeric and numarray

2006-12-13 Thread Christopher Barker
Eric Firing wrote:
> What is your present thinking with respect to timetable and strategy for 
> dropping Numeric and numarray support?

+1 for dropping them in future versions.

As John so eloquently pointed out recently, MPL is faced with a great 
challenge in supporting so many python versions, backends, etc. This in 
one place we can simplify.

In theory, MPL can use numpy internally, and still get data passed to it 
from Numeric and numarray with the array protocol, so you wouldn't be 
completely abandoning users stuck with the older packages.

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] MPL 0.87.7 and wxPython 2.8 and OS-X

2007-01-18 Thread Christopher Barker
Hi all,

Russell Owen just built an installer for MPL on OS_X for Python2.5, 
wxPython2.8.

To do it, he needed to patch

_wxagg.cpp, at line 238 as follows:

OLD:
wxBitmap *bitmap = new wxBitmap(image);
NEW
wxBitmap *bitmap = new wxBitmap(*image);

Thanks to a hint from Robin Dunn.

It now seems to work OK, except that when you use pylab.show() and then 
click on the toolbar buttons to zoom, etc, the buttons no longer display

Also, it doesn't work with Numeric 24.2 either -- I think that's a known 
issue, but I can't find a note about it at the moment.

Is anyone maintaining the wx back-end now?

Is MPL working with wxPython 2.8 on other platforms?

If anyone wants to try this binary out, it's temporarily at:

<http://www.astro.washington.edu/rowen/pythonpackages/Python%202.5/>


 >>> matplotlib.__version__
'0.87.7'
 >>> wx.__version__
'2.8.0.1'
 >>> numpy.__version__
'1.0.1'
 >>> Numeric.__version__
'24.2'


-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] ANN: matplotlib-0.90.0

2007-02-06 Thread Christopher Barker
Darn! missed the chance to update the wx back-end -- oh well, hopefully 
the next release.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Notes on switching backends to qt4 on mac os x

2007-02-07 Thread Christopher Barker
Thanks for doing this Rob, its nice to get as much support on OS-X as 
possible.

Does the QT back-end need to be compiled against QT? or is it python-only?

> QT4 takes *forever* to compile, but it seems to compile easier now  
> than previous versions that needed a small library hack.  The default  
> configuration compiles and installs fine.  The other tools (PyQt4 and  
> SIP) also compile and install painlessly with the default configuration.

Any chance you could package it up an submit it to the pythonmac archive?

Does it support a Universal build?

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] ANN: matplotlib-0.90.0

2007-02-07 Thread Christopher Barker
Werner F. Bruhin wrote:
> Great to see a new release, will put some time aside to test it with 
> wxPython early next week.

looking forward to your reports.

> which versions of wxPython are supported?

I haven't tried the new one, but the last release worked well with 
wxPython2.6.3, but had some issues with 2.8.* -- I don't think anyone 
has addressed those yet.

> Well, we haven't built any binaries yet.  We pushed a source release
> fast to try to get it into Feisty.  Sorry Chris!

well, I've been chattering on about this for awhile, but haven't 
contributed anything yet...

 > With wx2.8 out now
> and this being a major release, we definitely need to rethink wx
> builds.  We stuck with unicode for 0.87 to avoid confusion.  I would
> be happy to hear what wx users think/want.

I think it's time to just all unicode, all the way, but I mostly deal 
with English anyway.

> For me the ideal would be not to be depended on a particular release of 
> wxPython - big surprise no :-)

That would be nice.

> If I understand it correctly the dependency came in for performance 
> optimization, does 2.8 change something for this.

Perhaps. 2.8 has methods for directly setting the data in wxBitmaps. 
Before that, you needed to create a wxImage, then convert that to a bitmap.

However, to do that right, you'd need to be able to get the Agg bitmap 
as a Python buffer object that is in the binary form required by the 
platform. I think the majors need RGB and/or RGBA, but I'm not totally 
sure about that (maybe OS-X is ARGB?)

> - If yes, I would not see a problem with 0.9 requiring as a minimum 
> 2.8.0.1 but going forward I could use any 2.8.x or newer release.

That would be a good way to go, or have fallback on the older methods 
for less than 2.8 -- so instead of saying "you need 2.8 to use the wx 
backend" we can say: "you'll get better performance with wx if you use > 
2.8"

> - If no, then I guess we have to live with having a "fixed" dependency, 
> e.g. 0.87 is wxPython 2.6.x, 0.90 is wxPython 2.8.x, but it should 
> through at least a warning if one tries to use it with another wxPython 
> release.

Yes, it should. I've also started a patch for the build system that 
tries harder to make sure that you are building against the same wx that 
you are running -- that will at least help people built it themselves 
more easily.

NOTE: I took a look at the wx backend code a while ago, and it looks 
like even without the new Bitmap handlers in 2.8, it could be faster 
with straight Python code. Key is that a wxImage can be created from a 
Python buffer object without copying the data. So if we can expose the 
Agg buffer as a Python buffer, as RGB, then we should be able to get 
decent performance with pure python. You'd still need to do the 
wxBitmapFromImage thing, but the accelerated back-end does that too.

Look for a thread on this list a while back, with my and Ken's name on it.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] WXAgg backend updates

2007-02-22 Thread Christopher Barker
Thanks Ken!!


 > More importantly, I written
> another set of the agg-to-wx.Bitmap conversion routines that uses the  
> new BitmapFromBufferRGBA() function in wxPython 2.8.

Are these in Python or c++?

> The blit()  
> routine also got a bit faster after I realized it was more efficient  
> to just convert the whole buffer and blit part of it instead of  
> clipping during conversion.

really? interesting -- it shows you never know!

> I have tested these changes with wxPython 2.8.1.1 under OSX 10.4.8.   
> My goal is that none of the changes break compatibility with wxPython  
> 2.4 or 2.6.

um, how is that possible if you're using the new 2.8 functions?

> I'd really appreciate it if someone could test and  
> benchmark those versions using `examples/animation_blit_wx.py'.

I'll see what I can do.

By the way, did you see the weird toolbar behavior with 2.8 on OS-X?

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] WXAgg backend updates

2007-02-22 Thread Christopher Barker
Ken McIvor wrote:
>> Are these in Python or c++?
> 
> Since BitmapFromBuffer() and its aforementioned cousin are covered in 
> the wxWidgets documentation for wxBitmap, I believe they're mostly in C++.

umm, I meant, is YOUR code in Python or C++, but it looks like you 
answered that below:


>> um, how is that possible if you're using the new 2.8 functions?
> 
> There are two conditional checks based on wx.__version__.  One is in 
> setup.py to not build the C++ accelerator for wxPython 2.8.  The other 
> is in backend_wxagg.py and figures out which of the three agg/wx.Bitmap 
> conversion implementations to use -- the pure Python routines, the C++ 
> accelerator, or the wxPython 2.8 edition of the pure Python routines.

Ah. I had written some "smarts" for setup.py (and utilities it uses) to 
do a better job of finding the correct wx-config. Is there any point to 
that now? If so, I'll sent it along to you.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] memory leaks

2007-03-28 Thread Christopher Barker
You used gnuplot to plot MPL memory use?

for shame, for shame!

;-)

-Chris

Tom Holroyd (NIH/NIMH) [E] wrote:
> as shown in the graph, then stabilizes.

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] when to deprecate numeric and numarray?

2007-04-04 Thread Christopher Barker
John Hunter wrote:
>   * I suppose we should deprecate it for a release, but I'm inclined
> just to push the thing through quickly

+1

You can't do it too fast for me.

 >* when we do the cleanup, we should replace all the 'from numerix
 >import something' with 'import numpy as nx; nx.something'

+1

 > Where possible when cleaning a given module for numerix, we should
 > standardize the other imports.  Eg, instead of 'from cbook import
 > iterable' we should do 'import matplotlib.cbook as cbook;
 > cbook.iterable'

+1

all around a good plan.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] What is the OS-C egg built against?

2007-04-09 Thread Christopher Barker
Hi all,

I'm having trouble getting an MPL 0.90.0 working with wxPython 2.8 on OS-X.

Does anyone know what the egg on the sourceforge site is built with?

Is that documented somewhere?

As I understand it, Ken made some changes for wxPython 2.8 in svn, but I 
don't see any mention of them in the 0.90.0 CHANGELOG, so it looks like 
they haven't made it into the distribution yet. darn.

oh well, off to set things up to compile.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Is it possible to do a point release for wxAgg?

2007-04-11 Thread Christopher Barker
Hi all,

The world of wxAgg and versions of wxPython has been a big pain for a 
while. I've been poking around trying to get MPL working with wxPython 
on OS-X with wxPython2.8, and it's been far too much work.

However, Ken McIvor has apparently solved the problem. Unfortunately, he 
committed the changes on Feb 22, and it looks like the 0.90.0 release 
was done on Feb 6. Darn.

My understanding of the changes is:

There is now code in backend_wxagg.py that uses methods to create and 
manipulate wx.Bitmaps that is new to wxPython2.8. This should make the 
old accelerator code obsolete.

At runtime, the code determines if you are running >2.8, and if so, uses 
the new code. If not, it reverts to the old code, which checks for the 
accelerator, uses it if it's there, and uses the pure-python 
non-accelerated code if not.

So -- this should allow one to build a single executable that will work 
well with wxPython 2.6, 2.8 and future wxPythons.

Personally, I think we should just drop the accelerator altogether. If 
someone needs better performance, let them use wxPython2.8 ( I think 
there is some room for improvement in the pre-2.8 python code too -- you 
could build the wxImage from a buffer, rather than a string, saving one 
data copy).

If the accelerator is dropped, then the whole build process gets easier.

If people want to keep the accelerator, I wrote some code for 
setup_ext.py that checks what version of wx you have installed, and 
finds the wx-config that matches it. It could be adapted a bit to try to 
build only a wxPython2.6 version, and not try to build a 2.8 version, 
which fails at this point.

So, with a bit more testing and tweaking, we could get this all settled.

What's the consensus on keeping the accelerator?

Is it worth putting out a point release with these fixes?


-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release?

2007-05-31 Thread Christopher Barker
John Hunter wrote:
> Many moons ago, we talked about doing a bugfix release 0.90.1.  Since
> there are known bugs in the production release (eg Jeff Peery's recent
> plot_date bug) I would like to put out a new release.  Any objections?

I'd love to see a new release resolve the wxPython issues. Has this been 
done yet? See post a little while back for my suggestions.

Ken, are you there? Is it ready to go? Your thoughts?

When are thinking of getting it out -- I'm not sure when I'll have time 
to work on this (not in the next two days), but I'd really like to see 
this issue put to bed.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release?

2007-05-31 Thread Christopher Barker
John Hunter wrote:
> So if the wx stuff is ready to
> go, by all means let's check it in and include it, but if not I don't
> see that we need to hold for it.

I think all the real work is done, but I"m not totally sure what's 
checked in now. There may be some changes needed to the build scripts so 
that it doesn't try to build the accelerator by default.

> I am in favor of getting *all* the GUI dependent extension code out of
> MPL -- it is a support nightmare.

Actually, that's my proposal (and I think what Ken has done). The latest 
pure-python back-end uses wxPython2.8 methods to transfer the buffer. I 
propose that we just stop building the accelerator, and if people want 
better performance they need to switch to 2.8 (actually, I think the 
pre-2.8 code could be improved with pure python too, but I"m not going 
to bother, as I use 2.8 anyway)

> But I don't want to hold up the
> release cycle with known bugs in the wild unless someone says, "wait I
> just need a day or two".

I'll try to see if I can find a few hours to test and fix this stuff, 
but I've got some tight deadlines right now. If you don't hear from me 
or Ken, then I guess you might as well release away! (though just 
turning off the accelerator build may be all we need to do)

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release?

2007-05-31 Thread Christopher Barker
John Hunter wrote:
> If we have a pure python wxagg implementation that supports blitting,
> eg your Just Work with 2.8 changes, let's not bother building the 2.6
> extension code at all,

I think this is the way to go. Even with 2.6, it's a pain to get MPL to 
find the right libs, etc, if there is more than one version of wx on the 
system (like OS-X). I actually wrote some code to version check and find 
the right one, but I don't see the point with the changes Ken has made 
for 2.8

Pure Python is so much easier!

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] release?

2007-06-01 Thread Christopher Barker


John Hunter wrote:
>   I am not a wx user, so I leave it to the rest of you to
> confirm and or vet these changes.

I just built and tested SVN trunk on OS-X 10.4.9 with:

python 2.4 with wxPython2.6.3

and

python 2.5 with wxPython2.8.4

Not extensive testing, but it seems to work fine. Thanks!

NOTE: I first installed it over the older one in python2.4 with 
wxPython2.6, and got a garbage image. Then I deleted the old one, and 
re-installed, and it worked fine. I suspect that I had an old 
accelerator with the old one, which doesn't work right with the new one. 
It wasn't over-written, as the accelerator isn't being built by default 
anymore.



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Subsetting fonts in Postscript

2007-07-05 Thread Christopher Barker
Will this (whichever method is chosen) work for PDF too?

Just wondering,

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Memory leaks

2007-07-05 Thread Christopher Barker
Eric Firing wrote:
> I just updated from svn and tried to rerun the wx test, but ran into an 
> error:
> 
> [EMAIL PROTECTED]:~/programs/py/mpl/tests$ python 
>  wxapp.Yield()
> NameError: global name 'wxapp' is not defined

I think I just saw a note that Ken had committed a patch that a user had 
provided that kept the wx back-end from re-starting an event loop if 
there was one already running -- maybe that has something to do with 
this bug?

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Memory leaks

2007-07-05 Thread Christopher Barker
Ken McIvor wrote:
>> This qualifies as a wx bug, doesn't it?
> I believe so.  I'll file it.

I agree - a segfault is ALWAYS a bug.

>> If wx doesn't retain the reference, then instead of a segfault  
>> shouldn't it raise an exception?
> 
> I'd expect wx.GetApp() to work like the rest of wxPython and always  
> return the wx.App instance.

If a wx.App has not been created, it returns None:

 >>> import wx
 >>> wx.GetApp()
 >>> a = wx.GetApp()
 >>> print a
None

Which is probably what it should do if the wxApp() has been deleted.

In any case, you can only create one wxApp per program instance, and it 
can not be destroyed and re-started, so keeping a global instance around 
is probably the way to go.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] OT: licensing discussion

2007-07-06 Thread Christopher Barker
Sorry to spam this list with this, but it came up here...

Carl Worth wrote:
>> http://www.scipy.org/License_Compatibility
> 
> Thanks, John, for sharing this essay. Please allow me to respond to a
> few points:

Carl, you have clearly thought this out a lot, and have a real 
experience with this, so I have a issue that you may have some insights 
into:

I work for the US federal government, and we are not allowed to 
copyright our work, so be definition, any code we write is in the public 
domain. This means that we can not release code under the GPL, as you 
have to hold copyright to do that. This makes our managers nervous about 
using GPL'd libs (LGPL is fine, I'm a big fan of LGPL)

The FSF has unfortunately only ALMOST addressed these issues in their FAQ:

http://www.fsf.org/licensing/licenses/gpl-faq.html#GPLUSGov
http://www.fsf.org/licensing/licenses/gpl-faq.html#GPLUSGov

 From the answers to these FAQs, it's clear that we can release our code 
into the public domain, and it can then be combined with GPL code in a 
GPL project, so we can contribute to GPL and LGPL projects.

However, it still looks like we can't actually release a program 
ourselves under the GPL, and if a given program contains GPL code, then 
IIUC, it MUST be released under the GPL, so we've got a problem.

We could probably get around all this by developing the code, but having 
someone else release it, but the implications of that are still 
confusing to me.

To repeat: LGPL is OK -- while we might (and have) contribute to a 
library we use, we have no need to release a version of it ourselves.

Anyway, what all this means is that so far we've avoided GPL code for 
our projects -- something to keep in mind, the US gov't is a major user 
of Open Source Projects.

-Chris

PS: Google is remarkably unhelpful to me in figuring all this out. If 
anyone has useful references about the US Federal gov't developed and 
released software an the GPL -- please send me the links!

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] OT: licensing discussion

2007-07-06 Thread Christopher Barker
Carl Worth wrote:
> Yes, I have thought about licensing a lot. And I'll gladly share my
> opinions, (but no legal advice, of course, etc. etc.).

Thanks for your input.

>> I work for the US federal government, and we are not allowed to
>> copyright our work, so be definition, any code we write is in the public
>> domain.
> 
> Fantastic! And that's just as government work should be. (I used to
> work for a University research lab doing mostly government-funded
> project. Sadly, I saw lots of government funds getting poured down the
> drain to fund projects that resulted in proprietary software that wen
> nowhere.)

Well, what we produce ourselves is public domain, but what we spend 
taxpayers money on by hiring contractors is a totally different story. 
All too often contractors are paid to develop something that they keep 
all the rights too.

> You don't have to release code under the GPL. As you said, you
> can't. Just keep publishing that public domain code.

> Oops. I think you made a mistake here. Read the answer from the FSF
> again:
> 
>   Can the US Government release improvements to a GPL-covered
>   program?
> 
>   Yes. If the improvements are written by US government employees in
>   the course of their employment, then the improvements are in
>   the public domain. However, the improved version, as a whole,
>   is still covered by the GNU GPL. There is no problem in this
>   situation.

> And keep rereading that until the part that says "There is no problem
> in this situation" really sinks in. I don't know how I could word the
> reply more clearly than the FSF did.

Here is the distinction I (and our lawyers) see, that others don't seem 
to, so maybe I'm missing something. In essence, I see a distinction 
between contributing to a project someone else is releasing, and 
creating a derived work that I release myself. Maybe there is no difference.

Example of the two different situations:

1) I have written a bug fix or new feature to a GPL or LGPL piece of 
software that I want to contribute back. As it says above, no problem. I 
send it to an email list, post it in a bug tracker, whatever. It is now 
in the public domain, and it can be added to the GPL'd project. No 
problem here.

2) I have written a substantial application that makes some use of some 
GPL'd code. I want to put that app up on a government-run web site, and 
let people use it at their will. As I understand it, I am now 
"releasing" the application, and as it includes some GPL code, it MUST 
be released under the GPL. But I can't do that, because I don't hold 
copyright over the stuff I've written on the taxpayers time. So what do 
I do?

I could post all the code I wrote myself (released into the public 
domain), then post instructions how to combine it with the GPL code, 
compile it, and viola, you have your app, but that's not exactly making 
things as accessible as I'd like.

The work around is to find someone else to do the combining, compiling 
and releasing for us.

And here is the text of the GPL FAQ that I refer to:

"""
Can the US Government release a program under the GNU GPL?

If the program is written by US federal government employees in the 
course of their employment, it is in the public domain, which means it 
is not copyrighted. Since the GNU GPL is based on copyright, such a 
program cannot be released under the GNU GPL.
"""

And I have written the FSF, and not gotten a reply.

> So if I were in your situation, I would contribute to GPL projects by
> sending public-domain contributions.

Done and doing that.

>> Anyway, what all this means is that so far we've avoided GPL code for
>> our projects -- something to keep in mind, the US gov't is a major user
>> of Open Source Projects.
> 
> Please reconsider this, (or invite your lawyers to, or write to the
> Free Software Foundation as needed).

Honestly, it hasn't been difficult yet. As John has referred to, most 
Scientific code seems to not be GPL. We came close when we were going to 
use MySQL in a product, but we ended up going with a non-GPL Python 
Object DB instead.

> A quick scan through the Linux kernel source code, (obviously one of
> the most popular GPL-released projects), shows plenty of contributions
> from people with .gov email addresses, 

Sure, contributing is no problem, it's the releasing of derived works 
that has me concerned.

> Feel free to
> contact me off-list if you've got any questions about how to track
> down some potentially helpful email addresses there).

I do know NASA has released some stuff under the GPL, but I haven't 
tracked down how or why 

Re: [matplotlib-devel] numpification and imports

2007-07-13 Thread Christopher Barker
John Hunter wrote:
> I don't think this will work in this form.  artist is a module, and it
> is not imported simply by importing matplotlib
> 
> In [1]: import matplotlib as mpl
> 
> In [2]: mpl.artist

however, this seems to work (though it looks perhaps a bit odd)

>>> import matplotlib as mpl
>>> import matplotlib.artist
>>> mpl.artist



I do like this better -- names like mpl_*** rub me the wrong way. it
looks like you really want a namespace -- and indeed you do!

maybe the real solution is to have the matplotlib called "mpl" from the
get go, like wxPython does:

import wx
wx.Whatever...

I do wish that:

>>> import matplotlib as mpl
>>> import mpl.artist
Traceback (most recent call last):
   File "", line 1, in 
ImportError: No module named mpl.artist

worked.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Mathtext improvements

2007-07-16 Thread Christopher Barker


John Hunter wrote:
> That or we simply adopt the TeX standard

+1 TeX is widely used and well documented -- why have something almost 
the same?


though I still think the real solution is to sue TeX itself to do the 
typesetting. not the way we do now, but:

Parsing the DVI and laying out stuff that way -- so it's scalable, and 
has fewer dependencies.

Including the fonts required (STIX again -- maybe it will really happen 
eventually)

Occasionally someone pops up with plan to make an embeddable TeX engine, 
which is what we really want--maybe some day.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] rcParams and validation

2007-07-17 Thread Christopher Barker
Darren Dale wrote:
> John, Eric, have you had a look at the way IPython1 handles config files? 
> Here's a taste:

> In ipython's scheme, the config files 
> are loaded using execfile, I wonder if that might appear unsafe to anyone? 

This is, of course, terribly unsafe, but does anyone have a use case 
where that matters? I don't. I use python files for config all the time, 
and I love it! They are very readable, and I don't have to write a 
parser or document the syntax myself. I usually use import, rather than 
execfile, though I couldn't tell you why.

I have thought about the safety issue. One idea I've had (though I never 
bothered with it) was to strip the input files of "import" lines first. 
You could do a whole lot less if you couldn't import any arbitrary modules.

> I think it would be better to break a
> bunch of stuff all at once for a 1.0 release, than to break things
> incrementally with successive releases

+1



-Chris









-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mpl1 draft

2007-07-19 Thread Christopher Barker

Lots of god stuff John!

> There is also the question of whether
> we want to pay up and use 4x4 from the ground up and just ignore the
> 3rd dimension to open the door for 3D support. 

I say yes! 3-d really is a very often needed and requested feature. 
Sure, we can go to VTK or something for really sophisticated 3-d work, 
but being able to do the basic stuff with MPL would be wonderful.

If the framework supports it cleanly internally, it's much more likely 
that the 3-d stuff will get written.

> This is potentially a major win, because we currently
> move the data around on every draw.

Is it that expensive to push data around? In any case, it does sound 
cleaner and more efficient not to.

> Do we want to use 3x3 or 4x4 to leave the door open for 3D developers?

4X4 -- is there much cost?

> This approach requires the backends to be smarter, but they have to
> handle fewer entities.

How many back-ends does the future hold? It seems if the GUI toolkits 
all use *Agg, then that's only one render for all of them. Then we need:

SVG
PDF
PS
???

Cairo would be nice, as it gives us almost all of them at once, but I 
guess licensing keeps that a non-starter. Oh well.

> In matplotlib, the plot functions are matplotlib.axes.Axes methods and
> I think there is consensus that this is a poor design.

Well, the OO interface has always felt a bit clunky to me, but I'm not 
sure where else plot functions could go -- I'd love to hear ideas, though.

> Do we want to create high level objects like Circle, Rectangle and
> Line, each of which manage a Path object under the hood?

I like that idea -- working with Paths should be saved for the gurus.

> Just having the right Path object
> will reduce the need for many of these, eg LineCollection,
> PolygonCollection, etc... 

sounds good.

> Also, everything should be numpy enabled,
> and the sequence-of-python-tuples approach that many of the
> collections take should be dropped.

who hoo!

However, numpy doesn't handle "ragged" arrays well. I wonder if there's 
a good way to implement those, so that transforms can be done 
numpy-efficient.

> = Extension code =
> 
> If we can enhance the
> SWIG agg wrapper, we can also do images through there, getting rid of
> _image.cpp.  Having a fully featured, python-exposed agg wrapper will
> be a plus in mpl and beyond.

Very nice.

> But with the agg license change, I'm
> open to discussion of other approaches.

hmm GPL now. Well, maybe Cairo's LGPL isn't so bad after all!

> I want to do away with *all* GUI extension code.

yeah!

> = Traits =
> I think we should make a major committment to traits and use them from
> the ground up.

Good plan.

> = Breakage =
> 
> I think we need to be prepared to break the hell out of matplotlib.
> The API will basically be a significant rewrite. 

Well worth it.

 > pylab will still
> mostly work unchanged -- that is the beauty of pylab 

As a rule for the future though, a stable OO interface would be nice.

> Or we could forget all this wild speculation and resume our normally
> scheduled lives.

no!!

> = Chaco and Kiva =
> 
> It is a good idea for an enterprising developer to take a careful look
> at the current Chaco and Kiva

OK. I have to ask -- why aren't we all just using Chaco? I know I'm not 
because ??years ago, Enthought was not really supporting anything but 
Windows -- is that still true? Would it be a whole lot less work to 
support GTK, OS-X, ??? in Chaco than keep developing a separate lib?

Great conversation starters!

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread Christopher Barker
Ken McIvor wrote:
>>But is PIL something we plan to depend on?
> 
> I don't know, although I'm warming to the idea myself. 

Is PIL's DrawAgg numpy-aware? I suspect not. That could make difference 
when drawing lines with LOTS of points, for instance. I suppose we could 
contribute the array-aware code, but I don't know if it would be accepted.

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Christopher Barker
Rob Hetland wrote:
> First, it has bothered me that from pylab import * and from numpy  
> import * both import 'load' statements. Yes, I realize that I can put  
> them in their own name space, but I only use python for mpl and numpy  


That's why: "Namespaces are one honking great idea". They really are. 
Trust me on this.

Also, doesn't pylab hold all of numerix anyway? Why do you need both?

If you want to use the latest numpy API (which I do) then again -- 
"Namespaces are one honking great idea". This is what they are for.

Otherwise, you're stuck with using numerix and waiting until MPL goes 
pure numpy ( I don't know when that might be). pylab and numpy stomp all 
over each other (if you use import *) by design.

It comes down to this: if you use "import *" you're forced to use the 
decision made by others -- the numerix API, which, quite reasonably, 
they are keeping backward compatible.

Is it really that hard to use this?

import numpy as N # or "as npy", the mpl standard.

a = N.arange(10)

a.sum()

etc, etc...

One of the nice things about numpy is that there are lot more array 
methods, rather than functions, so it works better with namespaces -- 
you really don't need to type the "N." all that much.

from pylab import *
import numpy as N

May be a reasonable compromise.

 > -- for me python is a matlab replacement.

In many ways it is for me too, but it's so much better! take advantage 
of the advantages -- like namespaces.

If you're anything like me, you may not be writing big programs, but 
even quickie scripts are edited and re-edited a lot -- a little extra 
typing makes little difference.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread Christopher Barker
Darren Dale wrote:
> Is there much demand for BSD-compliant svg, pdf, and ps backends?

Is the demand any different than for any other back end?

I wonder about the demand for BSD MPL over all. I know we want people to 
be able to use MPL in proprietary apps, but the LGPL allows that.

How important is it that people can actually improve MPL without 
contributing those improvements back? Isn't that what BSD allows that 
LGPL doesn't?

By the way, isn't wxPython modified LGPL? We have a wx back-end.

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Christopher Barker
Paul Kienzle wrote:
> This is improved somewhat as:
> 
>   import numpy as N
>   res = N.sqrt(2*N.sin(N.pi*x**2) + N.cos(x**2) - N.exp(2*N.pi*1j))
> 
> but the following is better:
> 
>   from mpl.math import *
>   res = sqrt(2*sin(pi*x**2) + cos(x**2) - exp(2*pi*1j))

quite true. Interestingly, I find that expressions like that are not a 
large fraction of my code these days -- maybe that's a bad thing, I used 
to do math!

> Can we create a math.py which makes a standard set of math functions
> available?

You're right that for math expressions, it is nice to have them in the 
namespace, so this is used a lot:

from numpy import sqrt, sin, cos, exp

Maybe it's a reasonable idea to write a Nmath.py, which would have an 
import line like that.

Out of 491 names in the numpy namespace, I found 26 that would commonly 
be found in math expressions. Not bad, really, much better than 
including all 491.

Inf
NaN
abs
angle
arccos
arccosh
arcsin
arcsinh
arctan
arctan2
arctanh
cos
cosh
exp
log
log10
pi
sign
sin
sinc
sinh
sqrt
square
tan
tanh


> I'm guessing a function sqrt(-1.) which returns 1j is out of the question?

what's wrong with "1j" as a literal?

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mpl1 draft

2007-07-20 Thread Christopher Barker
> On Jul 19, 2007, at 12:18 PM, John Hunter wrote:
>> I also plan to use the SWIG agg wrapper

Where can I find that? I did some googling, and no luck.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Christopher Barker
Robert Kern wrote:
> Rob Hetland wrote:
>> There is also quite a bit of advice on the internet and otherwise  
>> that 'from numpy import *' is the way to import the library.  For  
>> example, this is the approach in Oliphant's 'Guide to Numpy.'
> 
> You'll often see it in examples because it's the only way to make examples 
> clear
> and to the point. It's not a recommendation.

Indeed. way back when, in the days of Numeric, it WAS the 
recommendation, then we were in a state of flux, and as Robert said, 
many quick examples are still written using "import *".

However, I have seen a real shift on the numpy list over the last year 
(or two), toward using the namespace.

Paul Kienzle wrote:
> On Fri, Jul 20, 2007 at 12:34:44PM -0700, Christopher Barker wrote:
>> Out of 491 names in the numpy namespace, I found 26 that would commonly 
>> be found in math expressions. 

> The C99 math/complex headers define a number of symbols.

Sure, but you don't need all of those. My idea was thus:

"Namespaces are one honking great idea"

but they are kind of ugly inside math expressions. But:

"Practicality beats purity"

so I think it does make sense to bring the common names that show up in 
math expressions into the main namespace. Not all the handy little names 
( like isnan, zeros, linspace, etc.) only the ones that show up in the 
depths of nested math expressions, so that we can write code that looks 
like math. That's how I came up with my personal list of 26.

This is probably best just done by each individual according to his/her 
taste.

Rob Hetland wrote:
> I get namespaces.  They are really great.  It's just that I use numpy 
> and mpl *so* much that the namespaces get in the way.

Maybe using Paul's suggestion of having a "math" namespace that you 
"import *" would help.

Or use "from pylab import *" and reference just the numpy names you want 
separately.

> And really, numpy and mpl coexist beautifully, except for a few small 
> exceptions.  'load' is one.  (There are others I have run across as well).
> 
> I think mpl should play nice even for folks like me who occasionally 
> like to abandon separate namespaces.

But it does. numpy was designed pretty much to do just that -- give you 
one big namespace to import. And it provides the numerix interface as 
part of that.

However, if you do that, you have to deal with the decisions MPL 
developers make. numpy is designed by a separate team, and is not 
designed to be "import *"ed into the pylab namespace (I think it is 
designed not to clash with the python built-ins at least). This is a 
common issue with packages developed by different people for similar 
purposes, and python already has namespaces as a great way to deal with it!

Indeed, in this case, I suppose it's the numpy folks that aren't 
"playing nice" -- numpy.load was added after pylab.load was already 
there. But it's not a goal of the numpy team to be name-compatible with 
pylab.

-Chris

This is really is pretty OT for the devel list, though, so I'll stop here.








-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Polygon examples broken

2007-07-20 Thread Christopher Barker
>> so I think it does make sense to bring the common names that show up in 
>> math expressions into the main namespace.

>> This is probably best just done by each individual according to his/her 
>> taste.
> 
> That's what I'm trying to get away from.  I want to be able to write
> the contains() function in patch.py and just use the normal math where
> it makes sense to use normal math.

Ahh -- we're back on an a mpl-devel topic now.

I was thinking that you were proposing a "math" namespace for pylab 
users -- but it sounds like you're proposing a standard set of math 
names that will be brought in to modules for the matplotlib project 
itself. Different issue.

I don't write enough MPL internal code to have any opinion on that.

Does anyone else think this is a good idea?

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mpl.math namespace [was: Polygon examples broken]

2007-07-21 Thread Christopher Barker
John Hunter wrote:
> We should prefer the numpyisms anyway, a.max(), a.min(), a.absolute().

Exactly -- OO semantics make the whole namespace thing much more workable.

To sum up a bit -- This all started with a comment about how some of the 
pylab names clash with numpy names, so that:

from pylab import *
from numpy import *

doesn't quite work.

I waded in with my usual obsessive advocacy for namespaces, and then it 
was pointed out that in math expressions, all those name space prefixes 
made things look pretty ugly. I conceded that is the case, and that in 
the interests of "practicality beats purity", that maybe having a 
standard set of math symbols in a module to be import *'ed in could be a 
good idea.

Now to my personal advocacy about this idea:

I think that convenience overriding the clarity of namespaces ONLY 
applies to math expressions, like the example given:

 >   res = sqrt(2*sin(pi*x**2) + cos(x**2) - exp(2*pi*1j))

really is easier to deal with than:

>   res = npy.sqrt(2*npy.sin(npy.pi*x**2) + npy.cos(x**2) - 
> npy.exp(2*npy.pi*1j))

But it's not about saving typing -- it's about having math look like 
math. So the measure of whether a given name should be in the "math" 
namespace should be whether it's a "math" function, vs. a programming 
function.

Now some data:

Paul Kienzle wrote:
> I'll let the code speak for itself:
> 
> ~/src/matplotlib/lib/matplotlib pkienzle$ for sym in $symlist; do 
>> echo `grep "[^A-Za-z0-9_]$sym[^A-Za-z0-9_]" *.py | wc -l` $sym; 
>> done | sort -n -r | column -c 75
> 163 max 7 remainder 1 cosh  0 isnormal
> 136 arg 7 pow   1 arctanh   0 isinf
> 109 min 7 inf   1 arcsinh   0 isfinite
> 102 log 6 arctan2   1 arccosh   0 frexp
> 64 pi   5 fabs  0 trunc 0 fmin
> 56 sqrt 4 imag  0 tgamma0 fmax
> 44 abs  3 tan   0 signbit   0 fdim
> 38 sin  3 nan   0 scalbn0 expm1
> 28 cos  3 log2  0 rint  0 exp2
> 23 minimum  3 hypot 0 remquo0 erfc
> 22 round2 isnan 0 nexttoward0 erf
> 19 maximum  2 arctan0 nearbyingt0 cproj
> 19 floor2 arcsin0 modf  0 copysign
> 18 log102 arccos0 logb  0 conj
> 18 ceil 1 tanh  0 log1p 0 cbrt
> 13 real 1 sinh  0 lgamma0 NaN
> 12 exp  1 fmod  0 ldexp 0 Inf

Now we're looking at the same data -- but what conclusions do we draw?

I think the top three: max, arg, min, don't pass the test of being "math 
functions", so we have log, pi, sqrt, abs, sin, cos ... that see quite a 
bit of use, so, may it's worth it, but in all of the MPL code, even 102 
uses isn't that much -- and how many of those are buried in larger 
expressions? i.e.:

val = log(x)

isn't really that much better than:

val = npx.log(x)

It only really pays off in something contrived like:

z = sin(log(x) * exp(y) + log(n))**(1/log(t))

Now consider:

Eric Firing wrote:
> For many of these things there are up to 5 different possible sources:
> 
> (builtin, if not math or cmath)
> math
> cmath
> numpy
> numpy.ma
> maskedarray

I'd argue that for MPL, math and cmath are rarely needed, and we hope 
that soon there will only be one of numpy.ma and maskedarray, but 
nevertheless, it is an issue.

So my conclusion is that's it's not worth it, but reasonable people may 
disagree, of course!

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] cxx improvements

2007-08-09 Thread Christopher Barker


Eric Firing wrote:
> Swig: 
> GvR's comments are interesting.

Do you have a pointer to those? I'd love to see them.

My thoughts on SWIG:

It's real strength is that, being automated, it can be used to wrap 
large libraries, particularly ones that are constantly evolving 
(wxPython). Another one is that it is used for a lot of projects, so 
it's a handy tool to know. I'd never use it to wrap code written just to 
extend python.

By the way, it looks like there is now a code generator for boost:

http://www.language-binding.net/pyplusplus/pyplusplus.html

so that's another option -- but talk about dependencies!

And there's SIP, but I've never heard of it being used by anything other 
than PyQT

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] cxx improvements

2007-08-09 Thread Christopher Barker
Michael Droettboom wrote:
> Pyrex is "fun to use" and it allows code to be more gradually migrated 
> from Python to C.  We would need to take care to not add another 
> run-time dependency for users.

There are no run-time dependencies with Pyrex -- it generates C code, 
which is then compiled.
 >  (As an aside, I can't find the license
> of Pyrex.  Does anyone know what it is?)

No, but it doesn't matter as it won't get included in the project, only 
it's output would -- so it's like a compiler, not a library. Unless we 
want to write our own fork of it, which I doubt!

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] cxx improvements

2007-08-09 Thread Christopher Barker
> http://www.artima.com/weblogs/viewpost.jsp?thread=95863

Thanks
> (It was in Mike's original message.)

I must have missed that. Guido says:

"""
I've yet to see an extension module using SWIG that doesn't make me 
think it was a mistake to use SWIG instead of manually written wrappers. 
The extra time paid upfront to create hand-crafted wrappers is gained 
back hundredfold by time saved debugging the SWIG-generated code later.
"""

hmm. wxPython is my prime example. I can't imagine that ever being done 
enough to be useful without auto code generation. Period. Of course, 
that doesn't apply to far smaller libraries.

And many of the hand-written wrappers I've seen are nightmares of 
incorrect reference counting. I think hand-wrapping is a just plain bad 
idea, not when you have ctypes and pyrex and Boost (and CXX?) as options 
instead.

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mlab and pylab

2007-08-10 Thread Christopher Barker
Ryan May wrote:
>> I for one will be happy to change my code; numerical stuff in
>> numpy, plotting stuff in pylab (or pyplot?), though some things
>> like linspace() may be hard to loose; that's really an mlab
>> function and I can import mlab.

I'm a big namespace fan. I'd much rather see us all do something like:

import pyplot
import numpy as N
import mlab

etc.

In this case, there should be little name overlap between these modules, 
and you could "import *" all of them if you really wanted.

However, they are not all maintained by the same folks, so some overlap 
may occur, and that's a good reason for keeping them in separate namespaces.

In any case, it needs to be decided what the point of the mlab module 
is. There was a discussion about this a few (quite a few!) years ago 
when there was just Numeric, and it came with an mlab module (at least I 
think it was called mlab). At that point, we decided that Matlab 
compatibility wasn't really the point -- the point was that there were a 
number of nifty utilities in Matlab that people missed, and that the 
stuff in mlab wasn't completely Matlab compatible anyway (numpy and 
Matlab are just plain different, after all). We more or less decided to 
what we really needed was a "Utilities" module that could hold some of 
those nifty useful functions (like linspace, etc), but not much was done 
at the time. Since then, numpy as gained quite a bit of those features 
anyway.

So for this mlab module -- what is the goal?

1) A Matlab-like set of tools? In that case, it way want to default to 
matrices, rather than arrays, etc. If that's what's wanted, I'd make it 
a stand-alone module, that imports what it needs from numpy, but 
provides a complete API.

2) A bunch of extra utilities that numpy doesn't have, but are handy. In 
that case, I'd have it include only the extras, and one would need to 
import numpy and mlab both. It could also "import *" numpy , then add 
the extra stuff, but I'm too much of a namespace fan to advocate for 
that. What happens when numpy adds a name that clashes with an mlab 
name, for instance?

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mlab and pylab

2007-08-10 Thread Christopher Barker
Eric Firing wrote:
> I do not think mlab 
> should "from numpy import *"; if that is what someone wants, they can do 
> it explicitly themselves, very easily.  Now, pylab should do something 
> like "from mlab import *; from numpy import *; from pyplot import *", 
> but mlab should be its own nice, clean set of functions.

+1

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mlab: please check

2007-08-12 Thread Christopher Barker
Fernando Perez wrote:
> On 8/12/07, Eric Firing <[EMAIL PROTECTED]> wrote:
>> mlab.py in svn has now been changed quite a bit:

> But if I may make a small comment, in my view MPL should simply not
> contain any numerics, period (beyond that needed for plotting
> functions). 

For the most part,m I agree with Fernando on this. However, the numpy 
team is making a concerted effort to have numpy be pretty straight core 
functionality. All the stuff in mlab will not and should not be put into 
numpy.

However, it's a lot of useful stuff. What to do?

I think it probably belongs in SciPy -- after all, SciPy is a lot of 
useful stuff (some domain-specific, some not) built on top of numpy.

However, mlab is now in MPL, and I think Eric is doing a great job of 
cleaning things up, so that the mlab module it self could easily be 
moved somewhere else in the future.

A couple points to keep in mind:

Does internal MPL code rely on mlab? if so, it needs to be part of some 
core lib that is stable enough to be a MPL dependency.

Despite what Fernando and I think, a lot of people DO want MPL to be an 
all-in-one plotting AND computing environment -- like Matlab. I think 
Scipy is what should be the complete environment, and I think it's 
getting close, but there are all still issues, so MPL does fill a need.

-Chris



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] mathtext in wx widgets

2007-08-30 Thread Christopher Barker
Paul Kienzle wrote:
> It would be great to be able to display math markup in other parts of my
> application, such as labels, tables, lists and menus.  Has anyone ever
> tried doing this for wx or gtk?

It's worth a post to the wxPython-users list -- it gets talked about now 
and again.

It shouldn't be too hard to use the ustex stuff from MPL -- doesn't that 
use TeX, etc to make a png or something? If so, it could be stuck on a 
wx.widget easily.

Michael Droettboom wrote:
> (And long term, as cool as matplotlib is, it would be nice to refactor 
> this out as a separate library for apps that don't do any plotting...)

Yes, that would be great -- a kind of mini-TeX that's embeddable. 
Another plus to that is you'd expand the user base, and with that 
hopefully the developer base, so it could get fuller featured faster.

How tied in with MPL is the code? Could it just be it's own module?

-Chris



-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] anyone using gd and paint backends?

2007-09-07 Thread Christopher Barker
Michael Droettboom wrote:
> On a related note, I'm curious about usage of the Gdk and Wx (non-Agg) 
> rendering backends.  They both have various shortcomings relative to Agg 
> (no antialiasing, limited mathtext rotation, etc.).  Is there a real 
> performance or other reason to keep these maintained at this point?

I'm a heavy wx users, and have only used the wxAgg back-end.

However, if you are running an X application from a remote server, then 
the *Agg backends are much slower than the raw wx (or gtk) back ends -- 
I've never done it, but it has come up on this list. The reason is that 
it's faster to send the drawing commands over the network than the 
entire image buffer.

> don't see them as significantly easier for embedding in applications 
> than Agg (since both GtkAgg and WxAgg spell out how to get a native 
> image buffer from the Agg buffer without using C extensions).

You're right -- I don't think that's an issue.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] python-2.3 support

2007-09-21 Thread Christopher Barker
Michael Droettboom wrote:
> Is the current Mac OS-X version also something to consider? 

I don't think so. You really need to install a newer/better version to 
do anything significant with python on OS-X -- particularly anything 
with a GUI.

John Hunter wrote:
> We don't really need generator
> comprehensions -- in the examples you highlighted I think they were
> used for syntactic convenience, though admittedly in some cases syntax
> conveniences are compelling.

Sure they are, but wouldn't list comprehensions be just as good? at 
least in those cases.

-Chris





-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Inches?

2007-10-29 Thread Christopher Barker
Eric Firing wrote:
> Somewhere along the line, it may make sense to support the metric system 
> better in mpl.

It seems to me that the "right" way to do this is to use some sort of 
"array-with_units" class. Then what MPL would except was a "length", and 
the user would specify what they want. i.e:

figure(figsize = units.inches((8.5,11))

rather than:

figure(figsize = (8.5, 11), units=inches)

Though this does make for more typing. With the later way, a system 
default for units could be used more easily.

I really want a unit class like this for other stuff anyway.

-- just thinking in email....

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] OS X Leopard install, snag

2007-11-05 Thread Christopher Barker
John Hunter wrote:
> Now for my next problem: I built zlib, libpng an freetype from source
> and I get a

William Kyngesburye is building and maintaining a nice set of Universal 
Frameworks of various libs that are more or less standard on Linux:

http://www.kyngchaos.com/software/unixport/frameworks

Maybe they would be a good set to use as a standard recommendation for 
folks building/using MPL on OS-X.

I think the Freetype and UnixImageIO Frameworks would cover it for MPL.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] internal enthought.traits package: a progress report

2007-11-07 Thread Christopher Barker
Darren Dale wrote:
> Does the way matplotlib handles pytz and datetime present significant 
> complications as well?

not too bad, but pytz and datetime are already pretty easy to install, 
self-contained packages.

> But not all systems have a package manager, and not all package managers have 
> support for traits.

I really don't think there is much choice here. Until (if) traits is 
widely available in an easy-to-install form (binaries for Windows and 
OS-X, "just works" with easy-install, rpms, and debs for Fedora, Ubuntu, 
Debian) MPL is going to have to keep a copy internally, just like it 
does for Agg, etc.

The first step to the easy-to-install form is for:

setup.py build

to "just work" on all platforms that are setup right to build python 
extensions (have the right compiler, etc) -- is that the case yet? Once 
it is, it's not hard for various folks to build binaries for various 
platforms.

As for bundling -- if it's installed and working, py2exe and py2app 
should just work -- if they don't, then a little tweaking may be needed, 
which we can make into a recipe for py2app, and a Wiki page for py2exe 
(is there anything like recipes for py2exe?)

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Backends status on transforms branch

2007-11-08 Thread Christopher Barker
Michael Droettboom wrote:
> Wx supports polycurves in its new wxGraphicsContext API (but not the 
> wxDC API that mpl uses now).  This means a fairly complete rewrite of 
> the wx backend,

not necessarily. You can create a GraphicsContext from a wx.DC, you may 
be able to just add that step for drawing polycurves.


> since you 
> can no longer draw to an in-memory buffer, but only a true wxClientDC). 

you can create a GraphicsContext from a wxMemeoryDC, so yes, you can 
draw to a buffer.

I haev no idea what the impact on performance would be, but in general, 
GraphicsContext is slower than DC.

> So, we need to look at the pros/cons of continuing to support these 
> legacy APIs going forward.

yup. I know I never need a non-agg wx, but then I can see why folks 
running remote X severs would want it.

I wonder if there is another way to speed that up with Agg -- can you 
compress the bitmap data to pass it to the Xserver? is that happening 
already?

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


  1   2   >