David Cournapeau | 1 Dec 2008 04:44
Picon
Gravatar

Re: ANNOUNCE: EPD with Py2.5 version 4.0.30002 RC2 available for testing

On Mon, Dec 1, 2008 at 7:00 AM, Darren Dale <dsdale24 <at> gmail.com> wrote:
> I tried installing 4.0.300x on a machine running 64-bit windows vista home
> edition and ran into problems with PyQt and some related packages. So I
> uninstalled all the python-related software, EPD took over 30 minutes to
> uninstall, and tried to install EPD 4.1 beta.

My guess is that EPD is only 32 bits installer, so that you run it on
WOW (Windows in Windows) on windows 64, which is kind of slow (but
usable for most tasks).

> Next I tried installing the 64-bit 2.6 installer from python.org, and I got
> a message saying I needed to log in as an administrator to install for all
> users. My account is listed as an adminstrator account, so I don't
> understand what the problem is. I was able to install 2.6 just for my
> account, instead of for all users, but I was not able to install EPD 4.1
> just for my account, it failed with the same error as it did when I
> installed for all users.

You should report those issues on python bug tracker, I think. More
generatlly, correct windows installers are a  tricky business,
specially when you start using dll. In particular, many things are
under-documented (dll manifest and co); I know from the python-dev ML
that python developers had a hard time solving those issues. Maybe not
everything was sorted out, although I am a bit surprised about
straight python 2.6 installer.

David
Gael Varoquaux | 1 Dec 2008 09:12
Favicon
Gravatar

Re: ANNOUNCE: EPD with Py2.5 version 4.0.30002 RC2 available for testing

On Mon, Dec 01, 2008 at 12:44:10PM +0900, David Cournapeau wrote:
> On Mon, Dec 1, 2008 at 7:00 AM, Darren Dale <dsdale24 <at> gmail.com> wrote:
> > I tried installing 4.0.300x on a machine running 64-bit windows vista home
> > edition and ran into problems with PyQt and some related packages. So I
> > uninstalled all the python-related software, EPD took over 30 minutes to
> > uninstall, and tried to install EPD 4.1 beta.

> My guess is that EPD is only 32 bits installer, so that you run it on
> WOW (Windows in Windows) on windows 64, which is kind of slow (but
> usable for most tasks).

On top of that, Vista is not supported with EPD. I had a chat with the
EPD guys about that, and they say it does work with Vista... most of the
time. They don't really understand the failures, and haven't had time to
investigate much, because so far professionals and labs are simply
avoiding Vista.

Hopefully someone from the EPD team will give a more accurate answer
soon.

Gaël
Timmie | 1 Dec 2008 11:22
Picon

optimising single value functions for array calculations

Hello,
I am developing a module which bases its calculations
on another specialised module.
My module uses numpy arrays a lot.
The problem is that the other module I am building 
upon, does not work with (whole) arrays but with
single values.
Therefore, I am currently forces to loop over the
array:

###
a = numpy.arange(100)
b = numpy.arange(100,200)
for i in range(0,a.size):
    a[i] = myfunc(a[i])* b[i]

###

The results come out well. But the problem is that this
way of calculation is very ineffiecent and takes time.

May anyone give me a hint on how I can improve my 
code without having to modify the package I am
building upon. I do not want to change it a lot because
I would always have to run behind the chnages in the 
other package.

To summarise:
How to I make a calculation function array-aware?

(Continue reading)

Emmanuelle Gouillart | 1 Dec 2008 11:28
Favicon
Gravatar

Re: optimising single value functions for array calculations

Hello Timmie,

numpy.vectorize(myfunc) should do what you want.

Cheers,

Emmanuelle

> Hello,
> I am developing a module which bases its calculations
> on another specialised module.
> My module uses numpy arrays a lot.
> The problem is that the other module I am building
> upon, does not work with (whole) arrays but with
> single values.
> Therefore, I am currently forces to loop over the
> array:
>
> ###
> a = numpy.arange(100)
> b = numpy.arange(100,200)
> for i in range(0,a.size):
>     a[i] = myfunc(a[i])* b[i]
>
> ###
>
> The results come out well. But the problem is that this
> way of calculation is very ineffiecent and takes time.
>
> May anyone give me a hint on how I can improve my
(Continue reading)

Matthieu Brucher | 1 Dec 2008 11:33
Picon

Re: optimising single value functions for array calculations

2008/12/1 Timmie <timmichelsen <at> gmx-topmail.de>:
> Hello,
> I am developing a module which bases its calculations
> on another specialised module.
> My module uses numpy arrays a lot.
> The problem is that the other module I am building
> upon, does not work with (whole) arrays but with
> single values.
> Therefore, I am currently forces to loop over the
> array:
>
> ###
> a = numpy.arange(100)
> b = numpy.arange(100,200)
> for i in range(0,a.size):
>    a[i] = myfunc(a[i])* b[i]
>
> ###

Hi,

Safe from using numpy functions inside myfunc(), numpy has no way of
optimizing your computation. vectorize() will help you to have a clean
interface, but it will not enhance speed.

Matthieu
--

-- 
Information System Engineer, Ph.D.
Website: http://matthieu-brucher.developpez.com/
Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92
(Continue reading)

Nadav Horesh | 1 Dec 2008 11:37

Re: optimising single value functions for array calculations

I does not solve the slowness problem. I think I read on the list about an experimental code for fast vectorization.

  Nadav.

-----הודעה מקורית-----
מאת: numpy-discussion-bounces <at> scipy.org בשם Emmanuelle Gouillart
נשלח: ב 01-דצמבר-08 12:28
אל: Discussion of Numerical Python
נושא: Re: [Numpy-discussion] optimising single value functions for array calculations

Hello Timmie,

numpy.vectorize(myfunc) should do what you want.

Cheers,

Emmanuelle

> Hello,
> I am developing a module which bases its calculations
> on another specialised module.
> My module uses numpy arrays a lot.
> The problem is that the other module I am building
> upon, does not work with (whole) arrays but with
> single values.
> Therefore, I am currently forces to loop over the
> array:
>
> ###
> a = numpy.arange(100)
(Continue reading)

Wim Bakker | 1 Dec 2008 12:31
Picon
Favicon

memmap & dtype issue

For a long time now, numpy's memmap has me puzzled by its behavior. When I use
memmap straightforward on a file it seems to work fine, but whenever I try to 
do a memmap using a dtype it seems to gobble up the whole file into memory. 
This, of course, makes the use of memmap futile. I would expect that the 
result of such an operation would give me a true memmap and that the data 
would be converted to dtype on the fly.

I've seen this behavior in version version 1.04, 1.1.1 and still in 1.2.1. 
I'm working on Windows haven't tried it on Linux. 

Am I doing something wrong? Are my expectations wrong? Or is this an issue
somewhere deeper in numpy? I looked at the memmap.py and it seems to me that
most of the work is delegated to numpy.ndarray.__new__. Something wrong there
maybe?

Can somebody help please?

Thanks!

Regards,

Wim Bakker
Stéfan van der Walt | 1 Dec 2008 13:14
Picon
Picon

Re: optimising single value functions for array calculations

2008/12/1 Nadav Horesh <nadavh <at> visionsense.com>:
> I does not solve the slowness problem. I think I read on the list about an
> experimental code for fast vectorization.

The choices are basically weave, fast_vectorize
(http://projects.scipy.org/scipy/scipy/ticket/727), ctypes, cython or
f2py.  Any I left out?  Ilan's fast_vectorize should have been
included in SciPy a while ago already.  Volunteers for patch review?

Cheers
Stéfan
Timmie | 1 Dec 2008 14:38
Picon

Re: optimising single value functions for array calculations

Hi,
>
thanks for all your answers. I will certainly test it.

> numpy.vectorize(myfunc) should do what you want.

Just to add a better example based on a recent
discussion here on this list [1]:

myfunc(x):
    res = math.sin(x)

    return res

a = numpy.arange(1,20)

=> myfunc(a) will not work.
=> myfunc need to have a possibility to pass single
values to math.sin either through interation
(see my inital email) or through other options.

(I know that numpy has a array aware sinus but
wanted to use it as an example here.)

My orriginal problem evolves from here timeseries
computing [2].

Well, I will test and report back further.

Thanks again and until soon,
(Continue reading)

Travis E. Oliphant | 1 Dec 2008 15:30

Re: memmap & dtype issue

Wim Bakker wrote:
> For a long time now, numpy's memmap has me puzzled by its behavior. When I use
> memmap straightforward on a file it seems to work fine, but whenever I try to 
> do a memmap using a dtype it seems to gobble up the whole file into memory. 
>   
I don't understand your question.  From my experience, the memmap is 
working fine.   Please post and example that illustrates your point.
> This, of course, makes the use of memmap futile. I would expect that the 
> result of such an operation would give me a true memmap and that the data 
> would be converted to dtype on the fly.
>   
There is no conversion on the fly when you use memmap.   You construct 
an array of the same data-type as is in the file and then manipulate 
portions of it as needed.
> Am I doing something wrong? Are my expectations wrong?
My guess is that your expectations are not accurate, but example code 
would help sort it out.

Best regards,

-Travis

Gmane