scipy.io.loadmat() excessively slow (regression)

Bug #538774 reported by Emanuele Olivetti
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-scipy (Ubuntu)
Fix Released
Undecided
Rick McBride

Bug Description

Binary package hint: python-scipy

Recent ubuntus (at least from 9.04 till lucid) provide scipy v0.7.0 (python-scipy) which has an important regression problem for the function scipy.io.loadmat(). The loadmat() imports data from Matlab format (".mat") files into NumPy arrays, a task which is very popular among scipy users. Note that there is no alternative to using this function if you need to work with Matlab files.

Scipy v0.7.0 introduced a severe regression problem in that function which became excessively slow, like requiring tens of minutes instead of ten seconds to load files. The result is that the loadmat() function is unusable in SciPy v0.7.0.

This bug has been tracked and solved by SciPy developers nearly one year ago with very simple patch. Details here, with a test case and thorough discussion:
http://thread.gmane.org/gmane.comp.python.scientific.devel/9934/focus=9974

The very simple patch is here:
http://article.gmane.org/gmane.comp.python.scientific.devel/9944
it modifies few lines of gzipstreams.py which lies here:
/usr/share/pyshared/scipy/io/matlab/gzipstreams.py
Note that within the discussion's thread there more than one patch was proposed, but the only correct one is the last proposed, which the above link refers to.

I am attaching the same patch here for your convenience.

Please apply it or upgrade python-scipy package to a more recent SciPy version.

Thanks.

Related branches

Revision history for this message
Emanuele Olivetti (emanuele-relativita) wrote :
tags: added: patch
Revision history for this message
Rick McBride (rmcbride) wrote :

I have a branch of the UDD branch for this waiting to be proposed when Maverick Meerkat opens up.

Changed in python-scipy (Ubuntu):
assignee: nobody → Rick McBride (rmcbride)
status: New → In Progress
Rick McBride (rmcbride)
Changed in python-scipy (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
malev (marcosvanetta) wrote :

Thanks for helping ubuntu.
Hi, could you provide us a link to the commit in the original project?
thanks

Revision history for this message
Rick McBride (rmcbride) wrote :

My branch is lp:~rmcbride/+junk/python-scipy

I guess I needed to push a branch to a different path in order to propose a merge. I'll fix that as soon as I remind myself where it should have been pushed.

Revision history for this message
Rick McBride (rmcbride) wrote :

Sorry about that. I did the fix branch prior to Maverick opening up. Correct branch is at
lp:~rmcbride/ubuntu/maverick/python-scipy/fix-538774

I'm about to propose the merge.

Revision history for this message
James Westby (james-w) wrote :

Isn't this fixed in the 0.7.2 in Debian unstable? If so then the fix will be in maverick in a
few days.

Thanks,

James

Emmet Hikory (persia)
tags: added: patch-accepted-debian patch-accepted-upstream
Revision history for this message
Daniel Holbach (dholbach) wrote :

Can you find out if it's closed in Debian and Maverick and close it if it is?

Changed in python-scipy (Ubuntu):
status: Fix Committed → Incomplete
Revision history for this message
Rick McBride (rmcbride) wrote :

checking on current debian and maverick status.

Revision history for this message
Rick McBride (rmcbride) wrote :

Maverick is Candidate: 0.7.0-2, where Lucid is Candidate: 0.7.0-2ubuntu1, which would seem to indicate removal of ubuntu-specific patches.

Debian stands at 0.7.2-1 0.

Do I need to do a sync request? or is this something that would already be in work?

Revision history for this message
James Westby (james-w) wrote :

This has now been synced.

Thanks,

James

Changed in python-scipy (Ubuntu):
status: Incomplete → Fix Released
Revision history for this message
Gael Varoquaux (gael-varoquaux) wrote :

Any chance that this fix gets backported in the 10.04 LTS? For people using matlab, this bugs makes scipy unusable in the LTS

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.