[Numpy-svn] r4650 - in branches/lib_for_io: . src
numpy-svn at scipy.org
numpy-svn at scipy.org
Fri Dec 28 17:13:47 EST 2007
Author: oliphant
Date: 2007-12-28 16:13:43 -0600 (Fri, 28 Dec 2007)
New Revision: 4650
Modified:
branches/lib_for_io/io.py
branches/lib_for_io/src/_compiled_base.c
Log:
Improve some docstrings
Modified: branches/lib_for_io/io.py
===================================================================
--- branches/lib_for_io/io.py 2007-12-28 07:29:22 UTC (rev 4649)
+++ branches/lib_for_io/io.py 2007-12-28 22:13:43 UTC (rev 4650)
@@ -1,7 +1,8 @@
__all__ = ['savetxt', 'loadtxt',
- 'loads', 'load',
- 'save', 'packbits', 'unpackbits',
+ 'load', 'loads',
+ 'save', 'savez',
+ 'packbits', 'unpackbits',
'DataSource',
]
@@ -19,18 +20,24 @@
Read a binary file (either a pickle or a binary NumPy array file .npy) and
return the resulting arrays.
- Parameters:
- -----------
- file - the file to read. This can be a string, or any file-like object
+ Parameters
+ ----------
+ file : file-like object or string
+ the file to read
- Returns:
- --------
- result - array or tuple of arrays stored in the file. If file contains
- pickle data, then whatever is stored in the pickle is returned.
+ Returns
+ -------
+ result : array, tuple, dict, etc.
+ data stored in the file.
+ If file contains pickle data, then whatever is stored in the pickle is returned.
+ If the file is .npy file than an array is returned.
+ If the file is .npz file than a dictionary-like object is returned which returns the
+ an array for each name in the file.
"""
if isinstance(file, type("")):
file = _file(file,"rb")
# Code to distinguish from pickle and NumPy binary
+ #
# if pickle:
return _cload(file)
Modified: branches/lib_for_io/src/_compiled_base.c
===================================================================
--- branches/lib_for_io/src/_compiled_base.c 2007-12-28 07:29:22 UTC (rev 4649)
+++ branches/lib_for_io/src/_compiled_base.c 2007-12-28 22:13:43 UTC (rev 4650)
@@ -848,7 +848,7 @@
PyDict_SetItemString(d, "__version__", s);
Py_DECREF(s);
- ErrorObject = PyString_FromString("numpy.lib._compiled_base.error");
+ ErrorObject = PyString_FromString("numpy.lib.error");
PyDict_SetItemString(d, "error", ErrorObject);
Py_DECREF(ErrorObject);
More information about the Numpy-svn
mailing list