summaryrefslogtreecommitdiff
path: root/numpy/core/memmap.py
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2009-10-02 19:36:37 +0000
committerPauli Virtanen <pav@iki.fi>2009-10-02 19:36:37 +0000
commit094a81e1352fb6b3a7a614fc8df23d0080cf7cb5 (patch)
tree0ec0b833b714ccf87085a43de363287edec5c7ee /numpy/core/memmap.py
parentd8f0614a886488b875e34555c590e6469e24102a (diff)
downloadnumpy-094a81e1352fb6b3a7a614fc8df23d0080cf7cb5.tar.gz
Docstring update: core
Diffstat (limited to 'numpy/core/memmap.py')
-rw-r--r--numpy/core/memmap.py37
1 files changed, 22 insertions, 15 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py
index 2392c3aa7..c11859fad 100644
--- a/numpy/core/memmap.py
+++ b/numpy/core/memmap.py
@@ -49,9 +49,9 @@ class memmap(ndarray):
Default is 'r+'.
offset : integer, optional
- In the file, array data starts at this offset. `offset` should be
- a multiple of the byte-size of `dtype`. Requires `shape=None`.
- The default is 0.
+ In the file, array data starts at this offset. Since `offset` is
+ measured in bytes, it should be a multiple of the byte-size of
+ `dtype`. Requires `shape=None`. The default is 0.
shape : tuple, optional
The desired shape of the array. By default, the returned array will be
1-D with the number of elements determined by file size and data-type.
@@ -75,10 +75,7 @@ class memmap(ndarray):
Given a memmap ``fp``, ``isinstance(fp, numpy.ndarray)`` returns
``True``.
- Notes
- -----
-
- Memory-mapped arrays use the the Python memory-map object which
+ Memory-mapped arrays use the Python memory-map object which
(prior to Python 2.5) does not allow files to be larger than a
certain size depending on the platform. This size is always < 2GB
even on 64-bit systems.
@@ -129,13 +126,6 @@ class memmap(ndarray):
>>> fpr.flags.writeable
False
- Cannot assign to read-only, obviously:
-
- >>> fpr[0, 3] = 56
- Traceback (most recent call last):
- ...
- RuntimeError: array is not writeable
-
Copy-on-write memmap:
>>> fpc = np.memmap(filename, dtype='float32', mode='c', shape=(3,4))
@@ -245,7 +235,24 @@ class memmap(ndarray):
self._mmap = None
def flush(self):
- """Flush any changes in the array to the file on disk."""
+ """
+ Write any changes in the array to the file on disk.
+
+ For further information, see `memmap`.
+
+ Parameters
+ ----------
+ None
+
+ See Also
+ --------
+ memmap
+
+ Examples
+ --------
+ Awaiting one...
+
+ """
if self._mmap is not None:
self._mmap.flush()