Skip to content

Commit 847e78a

Browse files
authored
Remove unused default+ keyword that is only used internally (#642)
Move it to the only two places where it is used; technically this is a change of API, but the function `normalize_store_arg` is only used internally. This make it a bit easier to follow what might happens when it is called; in particular this will let us be sure that it always returns a Store as as long as it is passed is a Store or a string, whicl before it could have returned anything depending on the value of default.
1 parent 06450d0 commit 847e78a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

zarr/creation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ def create(shape, chunks=True, dtype=None, compressor='default',
129129
return z
130130

131131

132-
def normalize_store_arg(store, clobber=False, default=dict, storage_options=None):
132+
def normalize_store_arg(store, clobber=False, storage_options=None):
133133
if store is None:
134-
return default()
134+
return dict()
135135
elif isinstance(store, str):
136136
mode = 'w' if clobber else 'r'
137137
if "://" in store or "::" in store:

zarr/hierarchy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,9 @@ def move(self, source, dest):
10361036

10371037

10381038
def _normalize_store_arg(store, clobber=False, storage_options=None):
1039-
return normalize_store_arg(store, clobber=clobber, default=MemoryStore,
1039+
if store is None:
1040+
return MemoryStore()
1041+
return normalize_store_arg(store, clobber=clobber,
10401042
storage_options=storage_options)
10411043

10421044

0 commit comments

Comments
 (0)