[Numpy-discussion] npy/npz file extensions in save/savez
Sat Jun 27 14:41:22 CDT 2009
The .npy/.npz extensions are just suggestions and can be replaced with
something application-specific according to the NEP (see "Conventions" in
http://svn.scipy.org/svn/numpy/trunk/doc/neps/npy-format.txt). However the
code in save/savez does not seem to allow this. Pass in 'filename.ext' and
out comes 'filename.ext.npy'. The relevant code in `save` is:
if isinstance(file, basestring):
if not file.endswith('.npy'):
file = file + '.npy'
Replacing the second line with:
if not os.path.splitext(file):
would fix it I think. Same for `savez`. `load` does the correct thing, it
only cares about the magic string and not the extension.
Should save/savez allow other extensions? If so, should I open a ticket and
attach this as a patch?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion