[NumPy-Tickets] [NumPy] #1527: numpy.savez() doesn't compress that much
NumPy Trac
numpy-tickets@scipy....
Thu Aug 26 05:32:32 CDT 2010
#1527: numpy.savez() doesn't compress that much
-------------------------+--------------------------------------------------
Reporter: sandro.tosi | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: Other | Version:
Keywords: |
-------------------------+--------------------------------------------------
Changes (by eteq):
* type: enhancement => defect
Comment:
I think this is actually a bug. There's a line in numpy/lib/npyio.py that
reads:
zip = zipfile.ZipFile(file, mode="w")
and to have the zipfile actually be compressed, it should say
zip = zipfile.ZipFile(file, mode="w",compression=zipfile.ZIP_DEFLATED)
Although it may be that this is done to prevent the function from failing
for those who don't have zlib installed... but this is probably better
fixed by doing:
try:
zip = zipfile.ZipFile(file, mode="w",compression=zipfile.ZIP_DEFLATED)
except RuntimeError:
zip = zipfile.ZipFile(file, mode="w",compression=zipfile.ZIP_STORED)
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1527#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list