Problem in mlab.py while creating .exe

Hi guys,

I’ve created a little software for
data analysis with your fantastic library.

I’ve made .exe with py2exe and since I’ve
upgraded to last revision my .exe was no more working.

version = ‘0.98.5.2’

revision = ‘$Revision: 6660 $’

date = ‘$Date: 2008-12-18 04:10:51
-0800 (Thu, 18 Dec 2008) $’

The problem came from mlab.py.

I needed to write this:

if psd.doc is not None:

psd.doc = psd.doc % kwdocd

else:

psd.doc = “”

because don’t know why but psd.doc
was None…

same for:

if csd.doc is not None:

csd.doc = csd.doc % kwdocd

else:

csd.doc = “”

and:

if specgram.doc is not None:

specgram.doc = specgram.doc %
kwdocd

else:

specgram.doc = “”

if cohere.doc is not None:

cohere.doc = cohere.doc %
kwdocd

else:

cohere.doc = “”

I know this is a quick ugly fix, but I had
to do a release so… J

I don’t use mlab.py but making a .exe
seems to include it and import it…

Any idea what should be THE good solution
to correct mlab.py, and do you mind to commit a patch for this issue?

On the website there is no doc to make a
.exe.

I’ve spent a lot of time making a setup.py
script to do a .exe. Have some interest in it?

Perhaps adding a section in the doc?

Cheers,

Laurent

mlab.py (102 KB)

I've created a little software for data analysis with your fantastic
library.

I've made .exe with py2exe and since I've upgraded to last revision my .exe
was no more working.
I know this is a quick ugly fix, but I had to do a release so… J

I don't use mlab.py but making a .exe seems to include it and import it…

Any idea what should be THE good solution to correct mlab.py, and do you
mind to commit a patch for this issue?

I don't think we'll take a patch of the form you have provided. But
I'm pretty sure there is a solution on the py2exe end that requires no
changes to mpl. py2exe is removing the doc, probably as a space
optimization. If you disable optimization in py2exe, the problem
should go away, eg

  http://lists.wxwidgets.org/pipermail/wxpython-users/2005-May/039506.html

On the website there is no doc to make a .exe.

I've spent a lot of time making a setup.py script to do a .exe. Have some
interest in it?

Perhaps adding a section in the doc?

Yes, definitely, I would be very interested in a FAQ with some example
code we could put in the examples dir. See

  http://matplotlib.sourceforge.net/faq/howto_faq.html#submit-a-patch
  http://matplotlib.sourceforge.net/faq/howto_faq.html#contribute-to-matplotlib-documentation

for instructions on how to contribute.

JDH

···

On Mon, Jan 12, 2009 at 5:04 AM, Laurent Dufrechou <laurent.dufrechou@...287...> wrote:

Thx you john, for you fast reply (as always).
You're true seems to be a py2exe optimization problem. I've got the good
origin of the problem.
So your true you don't have to include my ugly patch :slight_smile:

Thx for the link, will write a little tuto on making .exe!

Regards,
Laurent

···

-----Message d'origine-----
De : John Hunter [mailto:jdh2358@…287…]
Envoyé : lundi 12 janvier 2009 15:34
À : Laurent Dufrechou
Cc : matplotlib-users@lists.sourceforge.net
Objet : Re: [Matplotlib-users] Problem in mlab.py while creating .exe

On Mon, Jan 12, 2009 at 5:04 AM, Laurent Dufrechou > <laurent.dufrechou@...287...> wrote:

> I've created a little software for data analysis with your fantastic
> library.
>
> I've made .exe with py2exe and since I've upgraded to last revision
my .exe
> was no more working.
> I know this is a quick ugly fix, but I had to do a release so… J
>
> I don't use mlab.py but making a .exe seems to include it and
import it…
>
> Any idea what should be THE good solution to correct mlab.py, and do
you
> mind to commit a patch for this issue?

I don't think we'll take a patch of the form you have provided. But
I'm pretty sure there is a solution on the py2exe end that requires no
changes to mpl. py2exe is removing the doc, probably as a space
optimization. If you disable optimization in py2exe, the problem
should go away, eg

  http://lists.wxwidgets.org/pipermail/wxpython-users/2005-
May/039506.html

> On the website there is no doc to make a .exe.
>
> I've spent a lot of time making a setup.py script to do a .exe. Have
some
> interest in it?
>
> Perhaps adding a section in the doc?

Yes, definitely, I would be very interested in a FAQ with some example
code we could put in the examples dir. See

  http://matplotlib.sourceforge.net/faq/howto_faq.html#submit-a-patch
  http://matplotlib.sourceforge.net/faq/howto_faq.html#contribute-to-
matplotlib-documentation

for instructions on how to contribute.

JDH