|
16 | 16 | def create(shape, chunks=True, dtype=None, compressor='default',
|
17 | 17 | fill_value=0, order='C', store=None, synchronizer=None,
|
18 | 18 | overwrite=False, path=None, chunk_store=None, filters=None,
|
19 |
| - cache_metadata=True, read_only=False, object_codec=None, |
20 |
| - **kwargs): |
| 19 | + cache_metadata=True, cache_attrs=True, read_only=False, |
| 20 | + object_codec=None, **kwargs): |
21 | 21 | """Create an array.
|
22 | 22 |
|
23 | 23 | Parameters
|
@@ -54,6 +54,10 @@ def create(shape, chunks=True, dtype=None, compressor='default',
|
54 | 54 | lifetime of the object. If False, array metadata will be reloaded
|
55 | 55 | prior to all data access and modification operations (may incur
|
56 | 56 | overhead depending on storage and data access pattern).
|
| 57 | + cache_attrs : bool, optional |
| 58 | + If True (default), user attributes will be cached for attribute read |
| 59 | + operations. If False, user attributes are reloaded from the store prior |
| 60 | + to all attribute read operations. |
57 | 61 | read_only : bool, optional
|
58 | 62 | True if array should be protected against modification.
|
59 | 63 | object_codec : Codec, optional
|
@@ -115,7 +119,7 @@ def create(shape, chunks=True, dtype=None, compressor='default',
|
115 | 119 |
|
116 | 120 | # instantiate array
|
117 | 121 | z = Array(store, path=path, chunk_store=chunk_store, synchronizer=synchronizer,
|
118 |
| - cache_metadata=cache_metadata, read_only=read_only) |
| 122 | + cache_metadata=cache_metadata, cache_attrs=cache_attrs, read_only=read_only) |
119 | 123 |
|
120 | 124 | return z
|
121 | 125 |
|
@@ -342,8 +346,9 @@ def array(data, **kwargs):
|
342 | 346 |
|
343 | 347 |
|
344 | 348 | def open_array(store, mode='a', shape=None, chunks=True, dtype=None, compressor='default',
|
345 |
| - fill_value=0, order='C', synchronizer=None, filters=None, cache_metadata=True, |
346 |
| - path=None, object_codec=None, **kwargs): |
| 349 | + fill_value=0, order='C', synchronizer=None, filters=None, |
| 350 | + cache_metadata=True, cache_attrs=True, path=None, object_codec=None, |
| 351 | + **kwargs): |
347 | 352 | """Open an array using file-mode-like semantics.
|
348 | 353 |
|
349 | 354 | Parameters
|
@@ -377,6 +382,10 @@ def open_array(store, mode='a', shape=None, chunks=True, dtype=None, compressor=
|
377 | 382 | lifetime of the object. If False, array metadata will be reloaded
|
378 | 383 | prior to all data access and modification operations (may incur
|
379 | 384 | overhead depending on storage and data access pattern).
|
| 385 | + cache_attrs : bool, optional |
| 386 | + If True (default), user attributes will be cached for attribute read |
| 387 | + operations. If False, user attributes are reloaded from the store prior |
| 388 | + to all attribute read operations. |
380 | 389 | path : string, optional
|
381 | 390 | Array path within store.
|
382 | 391 | object_codec : Codec, optional
|
@@ -465,7 +474,7 @@ def open_array(store, mode='a', shape=None, chunks=True, dtype=None, compressor=
|
465 | 474 |
|
466 | 475 | # instantiate array
|
467 | 476 | z = Array(store, read_only=read_only, synchronizer=synchronizer,
|
468 |
| - cache_metadata=cache_metadata, path=path) |
| 477 | + cache_metadata=cache_metadata, cache_attrs=cache_attrs, path=path) |
469 | 478 |
|
470 | 479 | return z
|
471 | 480 |
|
|
0 commit comments