Re: [matplotlib-devel] Upstream Matplotlib Qt Designer Plugin

2012-03-25 Thread todd rme
On Mon, Mar 19, 2012 at 10:08 PM, Pierre Raybaut
 wrote:
> Hi all,
>
> Is anyone interested in including the Matplotlib QtDesigner plugin
> which I wrote for Python(x,y)?
>
> The code is quite simple and hasn't evolved for a while now (3 years)
> but apparently it is still appreciated by users even outside
> Python(x,y).
>
> Here are the two files which are necessary to make this plugin work:
> http://code.google.com/p/pythonxy/source/browse/src/python/matplotlib/QtDesigner_Plugins/matplotlibwidget.py
> http://code.google.com/p/pythonxy/source/browse/src/python/matplotlib/QtDesigner_Plugins/PyQt4/plugins/designer/python/matplotlibplugin.py
>
> The directory struture also has its importance:
> http://code.google.com/p/pythonxy/source/browse/#hg%2Fsrc%2Fpython%2Fmatplotlib%2FQtDesigner_Plugins
>
> Cheers,
> Pierre

I have been looking at the matplotlib widget code.  It is very helpful
for putting a widget inside PyQt4 windows.  However, it is lacking any
signals and slots to let you easily connect other Qt4 widgets with the
matplotlib one.  Particularly in Qt Designer, using signals and slots
to connect widgets together is very convenient.

I am willing to implement signals and slots, but I need some advice on
the best approach. So far I see three different approaches that may
work:

1. The simplest is just to manually add slots for common commands in
the widget.  I would also probably add some signals for things like
mouse clicks.  However, this requires manually creating the signals
and slots, and will break if matplotlib changes any of its api.  I
would also need to decide whether to use the matplotlib function
naming rules or the Qt4 ones (or both, since I can give the same
signal multiple names).

2. Integrate the signals and slots directly into matplotlib.  This
would probably involve somehow having matplotlib functions exposed as
signals and/or slots, probably somewhere in the PyQt4/pyside backend.
It would probably entail separating the PyQt4/pyside backend into a
PyQt4/pyside widget and a PyQt4/pyside window that contains that
widget.  All the interaction between settings, buttons, etc would use
signals and slots internally.  Users could then use the widget in
other contexts besides the window, and use the same signals and slots
the window uses.  This would also eliminate the need for a separate
widget to be used for Qt Designer. It would still require manually
specifying the signals and slots. I haven't looked in much detail, but
this is probably not that much more difficult than 1.

3. Make PyQt4 backend use widgets for everything.  Each object would
have all of its functions exposed as signals and slots, and all would
be usable in Qt Designer.  If I understand it correctly, the PyQt4
backend uses Agg for the actual painting, so this would require
implementing an entire new backend, so is probably not a good choice
initially.

Either approach would be

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] matplotlib v1.1.1 (bugfix) rc1 on Thursday

2012-03-25 Thread Derek Homeier
On 24.03.2012, at 8:16PM, Sandro Tosi wrote:
> 
> to run tests I use:
> 
> python -c "import matplotlib as m ; m.test(verbosity=1)"
> 
Ah, thanks for the reminder; that looks much more comprehensive! 
Actually the fink testing command requires an exit value of 1 or higher to 
detect errors, so I am using something like 
 "… r=m.test(verbosity=1); sys.exit(len(r.errors+r.failures))"

>> I have another question - I am trying to build a fink package with the 
>> documentation
>> and am wondering if "python make.py --small html"
> 
> In debian I use:
> 
> ./make.py --small all
> 
>> actually has any effect?
> 
> what do you mean?
> 
>> This still creates more than 70 MB of documentation, 24 MB in the _images 
>> subdir
>> alone, which increases the .deb size by a factor of ~2.5. How are you 
>> handling this
>> for the Debian package?
> 
> well, yes, the doc is huge (the debian package size is 52M compressed)
> and that is good; --small helped reducing the package size, setting
> 
>if small_docs:
>options = "-D plot_formats=\"[('png', 80)]\""
> 
> which reduced the type and size of the output images.

Indeed, I seemed to remember the regular output was not that much larger, 
but I must have missed all the hires.png and pdf images in the mpl_examples. 
They do account for additional 60-70 MB...
I was also curious if you had considered moving the docs to a separate package. 
I will propose one for fink; since there probably more people are building 
their 
packages themselves, the savings in build time might already justify that.

Cheers,
Derek


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] matplotlib v1.1.1 (bugfix) rc1 on Thursday

2012-03-25 Thread Sandro Tosi
Hi Derek,

On Mon, Mar 26, 2012 at 02:50, Derek Homeier
 wrote:
> I was also curious if you had considered moving the docs to a separate 
> package.
> I will propose one for fink;

yes, Debian has a separate package for documentation (since it
requires to be build just on time, whilc mpl requires to be built on
each architecture we support, so splitting the package results in a
lot of saved space). JFYR this is the layout of packages in Debian:

python-matplotlib - the python module
python-matplotlib-data - mpl-data dir + sampeldata + config files + nib + fonts
python-matplotlib-dbg - debug symbols for python extensions
python-matplotlib-doc - all the built doc, in html and pdf formats

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] matplotlib v1.1.1 (bugfix) rc1 on Thursday

2012-03-25 Thread Sandro Tosi
On Fri, Mar 23, 2012 at 18:55, John Hunter  wrote:
> On Fri, Mar 23, 2012 at 12:21 PM, Sandro Tosi  wrote:
>>
>>
>> I'll start testing debian packaging right away; for our package we
>> also need the sampledata tarball: can I reuse the one for 1.1.0 or is
>> a new one needed?
>>
>
> You can use the same one -- because this is a bugfix release, we have not
> introduced any new features, examples or data.  Just bugfixes.

Great!

The only thing I've noticed is:

- INSTALL contains a weird "numpy version |minimum_numpy_version|"
probably a missing substitution?

Other than that, the package was fine, and i've uploaded to Debian unstable.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel