@@ -27,7 +27,7 @@ class Group(Mapping):
2727 Group store, already initialized.
2828 path : string, optional
2929 Storage path.
30- readonly : bool, optional
30+ read_only : bool, optional
3131 True if group should be protected against modification.
3232 chunk_store : MutableMapping, optional
3333 Separate storage for chunks. If not provided, `store` will be used
@@ -40,7 +40,7 @@ class Group(Mapping):
4040 store
4141 path
4242 name
43- readonly
43+ read_only
4444 chunk_store
4545 synchronizer
4646 attrs
@@ -74,7 +74,7 @@ class Group(Mapping):
7474
7575 """
7676
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 ,
7878 synchronizer = None ):
7979
8080 self ._store = store
@@ -83,7 +83,7 @@ def __init__(self, store, path=None, readonly=False, chunk_store=None,
8383 self ._key_prefix = self ._path + '/'
8484 else :
8585 self ._key_prefix = ''
86- self ._readonly = readonly
86+ self ._read_only = read_only
8787 if chunk_store is None :
8888 self ._chunk_store = store
8989 else :
@@ -106,7 +106,7 @@ def __init__(self, store, path=None, readonly=False, chunk_store=None,
106106
107107 # setup attributes
108108 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 ,
110110 synchronizer = synchronizer )
111111
112112 @property
@@ -131,9 +131,9 @@ def name(self):
131131 return '/'
132132
133133 @property
134- def readonly (self ):
134+ def read_only (self ):
135135 """A boolean, True if modification operations are not permitted."""
136- return self ._readonly
136+ return self ._read_only
137137
138138 @property
139139 def chunk_store (self ):
@@ -156,7 +156,7 @@ def __eq__(self, other):
156156 return (
157157 isinstance (other , Group ) and
158158 self ._store == other .store and
159- self ._readonly == other .readonly and
159+ self ._read_only == other .read_only and
160160 self ._path == other .path
161161 # N.B., no need to compare attributes, should be covered by
162162 # store comparison
@@ -223,7 +223,7 @@ def __repr__(self):
223223 return r
224224
225225 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 , \
227227 self ._synchronizer
228228
229229 def __setstate__ (self , state ):
@@ -291,11 +291,11 @@ def __getitem__(self, item):
291291 """ # flake8: noqa
292292 path = self ._item_path (item )
293293 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 ,
295295 chunk_store = self ._chunk_store ,
296296 synchronizer = self ._synchronizer )
297297 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 ,
299299 chunk_store = self ._chunk_store ,
300300 synchronizer = self ._synchronizer )
301301 else :
@@ -342,7 +342,7 @@ def groups(self):
342342 path = self ._key_prefix + key
343343 if contains_group (self ._store , path ):
344344 yield key , Group (self ._store , path = path ,
345- readonly = self ._readonly ,
345+ read_only = self ._read_only ,
346346 chunk_store = self ._chunk_store ,
347347 synchronizer = self ._synchronizer )
348348
@@ -387,14 +387,14 @@ def arrays(self):
387387 path = self ._key_prefix + key
388388 if contains_array (self ._store , path ):
389389 yield key , Array (self ._store , path = path ,
390- readonly = self ._readonly ,
390+ read_only = self ._read_only ,
391391 chunk_store = self ._chunk_store ,
392392 synchronizer = self ._synchronizer )
393393
394394 def _write_op (self , f , * args , ** kwargs ):
395395
396396 # guard condition
397- if self ._readonly :
397+ if self ._read_only :
398398 raise ReadOnlyError ('group is read-only' )
399399
400400 # synchronization
@@ -449,7 +449,7 @@ def _create_group_nosync(self, name):
449449 raise KeyError (name )
450450 else :
451451 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 ,
453453 chunk_store = self ._chunk_store ,
454454 synchronizer = self ._synchronizer )
455455
@@ -495,7 +495,7 @@ def _require_group_nosync(self, name):
495495 elif not contains_group (self ._store , p ):
496496 init_group (self ._store , path = p , chunk_store = self ._chunk_store )
497497
498- return Group (self ._store , path = path , readonly = self ._readonly ,
498+ return Group (self ._store , path = path , read_only = self ._read_only ,
499499 chunk_store = self ._chunk_store ,
500500 synchronizer = self ._synchronizer )
501501
@@ -644,7 +644,7 @@ def _require_dataset_nosync(self, name, shape, dtype=None, exact=False,
644644
645645 if contains_array (self ._store , path ):
646646 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 ,
648648 chunk_store = self ._chunk_store , synchronizer = synchronizer )
649649 shape = normalize_shape (shape )
650650 if shape != a .shape :
@@ -838,7 +838,7 @@ def group(store=None, overwrite=False, chunk_store=None, synchronizer=None):
838838 elif not contains_group (store ):
839839 init_group (store , chunk_store = chunk_store )
840840
841- return Group (store , readonly = False , chunk_store = chunk_store ,
841+ return Group (store , read_only = False , chunk_store = chunk_store ,
842842 synchronizer = synchronizer )
843843
844844
@@ -851,7 +851,7 @@ def open_group(path, mode='a', synchronizer=None):
851851 path : string
852852 Path to directory in file system in which to store the group.
853853 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
855855 read/write (must exist); 'a' means read/write (create if doesn't
856856 exist); 'w' means create (overwrite if exists); 'w-' means create
857857 (fail if exists).
@@ -910,7 +910,7 @@ def open_group(path, mode='a', synchronizer=None):
910910 else :
911911 init_group (store )
912912
913- # determine readonly status
914- readonly = mode == 'r'
913+ # determine read only status
914+ read_only = mode == 'r'
915915
916- return Group (store , readonly = readonly , synchronizer = synchronizer )
916+ return Group (store , read_only = read_only , synchronizer = synchronizer )
0 commit comments