@@ -27,7 +27,7 @@ class Group(Mapping):
27
27
Group store, already initialized.
28
28
path : string, optional
29
29
Storage path.
30
- readonly : bool, optional
30
+ read_only : bool, optional
31
31
True if group should be protected against modification.
32
32
chunk_store : MutableMapping, optional
33
33
Separate storage for chunks. If not provided, `store` will be used
@@ -40,7 +40,7 @@ class Group(Mapping):
40
40
store
41
41
path
42
42
name
43
- readonly
43
+ read_only
44
44
chunk_store
45
45
synchronizer
46
46
attrs
@@ -74,7 +74,7 @@ class Group(Mapping):
74
74
75
75
"""
76
76
77
- def __init__ (self , store , path = None , readonly = False , chunk_store = None ,
77
+ def __init__ (self , store , path = None , read_only = False , chunk_store = None ,
78
78
synchronizer = None ):
79
79
80
80
self ._store = store
@@ -83,7 +83,7 @@ def __init__(self, store, path=None, readonly=False, chunk_store=None,
83
83
self ._key_prefix = self ._path + '/'
84
84
else :
85
85
self ._key_prefix = ''
86
- self ._readonly = readonly
86
+ self ._read_only = read_only
87
87
if chunk_store is None :
88
88
self ._chunk_store = store
89
89
else :
@@ -106,7 +106,7 @@ def __init__(self, store, path=None, readonly=False, chunk_store=None,
106
106
107
107
# setup attributes
108
108
akey = self ._key_prefix + attrs_key
109
- self ._attrs = Attributes (store , key = akey , readonly = readonly ,
109
+ self ._attrs = Attributes (store , key = akey , read_only = read_only ,
110
110
synchronizer = synchronizer )
111
111
112
112
@property
@@ -131,9 +131,9 @@ def name(self):
131
131
return '/'
132
132
133
133
@property
134
- def readonly (self ):
134
+ def read_only (self ):
135
135
"""A boolean, True if modification operations are not permitted."""
136
- return self ._readonly
136
+ return self ._read_only
137
137
138
138
@property
139
139
def chunk_store (self ):
@@ -156,7 +156,7 @@ def __eq__(self, other):
156
156
return (
157
157
isinstance (other , Group ) and
158
158
self ._store == other .store and
159
- self ._readonly == other .readonly and
159
+ self ._read_only == other .read_only and
160
160
self ._path == other .path
161
161
# N.B., no need to compare attributes, should be covered by
162
162
# store comparison
@@ -223,7 +223,7 @@ def __repr__(self):
223
223
return r
224
224
225
225
def __getstate__ (self ):
226
- return self ._store , self ._path , self ._readonly , self ._chunk_store , \
226
+ return self ._store , self ._path , self ._read_only , self ._chunk_store , \
227
227
self ._synchronizer
228
228
229
229
def __setstate__ (self , state ):
@@ -291,11 +291,11 @@ def __getitem__(self, item):
291
291
""" # flake8: noqa
292
292
path = self ._item_path (item )
293
293
if contains_array (self ._store , path ):
294
- return Array (self ._store , readonly = self ._readonly , path = path ,
294
+ return Array (self ._store , read_only = self ._read_only , path = path ,
295
295
chunk_store = self ._chunk_store ,
296
296
synchronizer = self ._synchronizer )
297
297
elif contains_group (self ._store , path ):
298
- return Group (self ._store , readonly = self ._readonly , path = path ,
298
+ return Group (self ._store , read_only = self ._read_only , path = path ,
299
299
chunk_store = self ._chunk_store ,
300
300
synchronizer = self ._synchronizer )
301
301
else :
@@ -342,7 +342,7 @@ def groups(self):
342
342
path = self ._key_prefix + key
343
343
if contains_group (self ._store , path ):
344
344
yield key , Group (self ._store , path = path ,
345
- readonly = self ._readonly ,
345
+ read_only = self ._read_only ,
346
346
chunk_store = self ._chunk_store ,
347
347
synchronizer = self ._synchronizer )
348
348
@@ -387,14 +387,14 @@ def arrays(self):
387
387
path = self ._key_prefix + key
388
388
if contains_array (self ._store , path ):
389
389
yield key , Array (self ._store , path = path ,
390
- readonly = self ._readonly ,
390
+ read_only = self ._read_only ,
391
391
chunk_store = self ._chunk_store ,
392
392
synchronizer = self ._synchronizer )
393
393
394
394
def _write_op (self , f , * args , ** kwargs ):
395
395
396
396
# guard condition
397
- if self ._readonly :
397
+ if self ._read_only :
398
398
raise ReadOnlyError ('group is read-only' )
399
399
400
400
# synchronization
@@ -449,7 +449,7 @@ def _create_group_nosync(self, name):
449
449
raise KeyError (name )
450
450
else :
451
451
init_group (self ._store , path = path , chunk_store = self ._chunk_store )
452
- return Group (self ._store , path = path , readonly = self ._readonly ,
452
+ return Group (self ._store , path = path , read_only = self ._read_only ,
453
453
chunk_store = self ._chunk_store ,
454
454
synchronizer = self ._synchronizer )
455
455
@@ -495,7 +495,7 @@ def _require_group_nosync(self, name):
495
495
elif not contains_group (self ._store , p ):
496
496
init_group (self ._store , path = p , chunk_store = self ._chunk_store )
497
497
498
- return Group (self ._store , path = path , readonly = self ._readonly ,
498
+ return Group (self ._store , path = path , read_only = self ._read_only ,
499
499
chunk_store = self ._chunk_store ,
500
500
synchronizer = self ._synchronizer )
501
501
@@ -644,7 +644,7 @@ def _require_dataset_nosync(self, name, shape, dtype=None, exact=False,
644
644
645
645
if contains_array (self ._store , path ):
646
646
synchronizer = kwargs .get ('synchronizer' , self ._synchronizer )
647
- a = Array (self ._store , path = path , readonly = self ._readonly ,
647
+ a = Array (self ._store , path = path , read_only = self ._read_only ,
648
648
chunk_store = self ._chunk_store , synchronizer = synchronizer )
649
649
shape = normalize_shape (shape )
650
650
if shape != a .shape :
@@ -838,7 +838,7 @@ def group(store=None, overwrite=False, chunk_store=None, synchronizer=None):
838
838
elif not contains_group (store ):
839
839
init_group (store , chunk_store = chunk_store )
840
840
841
- return Group (store , readonly = False , chunk_store = chunk_store ,
841
+ return Group (store , read_only = False , chunk_store = chunk_store ,
842
842
synchronizer = synchronizer )
843
843
844
844
@@ -851,7 +851,7 @@ def open_group(path, mode='a', synchronizer=None):
851
851
path : string
852
852
Path to directory in file system in which to store the group.
853
853
mode : {'r', 'r+', 'a', 'w', 'w-'}
854
- Persistence mode: 'r' means readonly (must exist); 'r+' means
854
+ Persistence mode: 'r' means read only (must exist); 'r+' means
855
855
read/write (must exist); 'a' means read/write (create if doesn't
856
856
exist); 'w' means create (overwrite if exists); 'w-' means create
857
857
(fail if exists).
@@ -910,7 +910,7 @@ def open_group(path, mode='a', synchronizer=None):
910
910
else :
911
911
init_group (store )
912
912
913
- # determine readonly status
914
- readonly = mode == 'r'
913
+ # determine read only status
914
+ read_only = mode == 'r'
915
915
916
- return Group (store , readonly = readonly , synchronizer = synchronizer )
916
+ return Group (store , read_only = read_only , synchronizer = synchronizer )
0 commit comments