Skip to content

Commit 0088fa4

Browse files
authored
Merge branch 'master' into fix-structured
2 parents b47044e + e095fe5 commit 0088fa4

File tree

5 files changed

+38
-15
lines changed

5 files changed

+38
-15
lines changed

docs/release.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,31 @@ Release notes
66
Unreleased
77
----------
88

9+
.. _release_2.9.4:
10+
11+
2.9.4
12+
-----
13+
914
Bug fixes
1015
~~~~~~~~~
1116

1217
* Fix structured arrays that contain objects
1318
By :user: `Attila Bergou <abergou>`; :issue: `806`
1419

20+
.. _release_2.9.3:
21+
22+
2.9.3
23+
-----
24+
1525
Maintenance
1626
~~~~~~~~~~~
1727

1828
* Mark the fact that some tests that require ``fsspec``, without compromising the code coverage score.
1929
By :user:`Ben Williams <benjaminhwilliams>`; :issue:`823`.
2030

31+
* Only inspect alternate node type if desired isn't present.
32+
By :user:`Trevor Manz <manzt>`; :issue:`696`.
33+
2134
.. _release_2.9.2:
2235

2336
2.9.2

requirements_dev_optional.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ types-redis
1212
types-setuptools
1313
pymongo==3.12.0
1414
# optional test requirements
15-
tox==3.24.1
15+
tox==3.24.3
1616
coverage
1717
flake8==3.9.2
1818
pytest-cov==2.12.1
1919
pytest-doctestplus==0.10.1
20-
h5py==3.3.0
20+
h5py==3.4.0
2121
s3fs==2021.6.0
2222
fsspec==2021.6.0
2323
aiobotocore!=1.4.0

zarr/creation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,9 @@ def open_array(
507507
# ensure store is initialized
508508

509509
if mode in ['r', 'r+']:
510-
if contains_group(store, path=path):
511-
raise ContainsGroupError(path)
512-
elif not contains_array(store, path=path):
510+
if not contains_array(store, path=path):
511+
if contains_group(store, path=path):
512+
raise ContainsGroupError(path)
513513
raise ArrayNotFoundError(path)
514514

515515
elif mode == 'w':
@@ -519,9 +519,9 @@ def open_array(
519519
object_codec=object_codec, chunk_store=chunk_store)
520520

521521
elif mode == 'a':
522-
if contains_group(store, path=path):
523-
raise ContainsGroupError(path)
524-
elif not contains_array(store, path=path):
522+
if not contains_array(store, path=path):
523+
if contains_group(store, path=path):
524+
raise ContainsGroupError(path)
525525
init_array(store, shape=shape, chunks=chunks, dtype=dtype,
526526
compressor=compressor, fill_value=fill_value,
527527
order=order, filters=filters, path=path,

zarr/hierarchy.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,18 +1162,18 @@ def open_group(store=None, mode='a', cache_attrs=True, synchronizer=None, path=N
11621162
# ensure store is initialized
11631163

11641164
if mode in ['r', 'r+']:
1165-
if contains_array(store, path=path):
1166-
raise ContainsArrayError(path)
1167-
elif not contains_group(store, path=path):
1165+
if not contains_group(store, path=path):
1166+
if contains_array(store, path=path):
1167+
raise ContainsArrayError(path)
11681168
raise GroupNotFoundError(path)
11691169

11701170
elif mode == 'w':
11711171
init_group(store, overwrite=True, path=path, chunk_store=chunk_store)
11721172

11731173
elif mode == 'a':
1174-
if contains_array(store, path=path):
1175-
raise ContainsArrayError(path)
11761174
if not contains_group(store, path=path):
1175+
if contains_array(store, path=path):
1176+
raise ContainsArrayError(path)
11771177
init_group(store, path=path, chunk_store=chunk_store)
11781178

11791179
elif mode in ['w-', 'x']:

zarr/tests/test_dim_separator.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,19 @@ def dataset(tmpdir, request):
3636
if which.startswith("static"):
3737
project_root = pathlib.Path(zarr.__file__).resolve().parent.parent
3838
if which.endswith("nested"):
39-
return str(project_root / "fixture/nested")
39+
static = project_root / "fixture/nested"
40+
generator = NestedDirectoryStore
4041
else:
41-
return str(project_root / "fixture/flat")
42+
static = project_root / "fixture/flat"
43+
generator = DirectoryStore
44+
45+
if not static.exists(): # pragma: no cover
46+
# store the data - should be one-time operation
47+
s = generator(str(static))
48+
a = zarr.open(store=s, mode="w", shape=(2, 2), dtype="<i8")
49+
a[:] = [[1, 2], [3, 4]]
50+
51+
return str(static)
4252

4353
if which.startswith("directory"):
4454
store_class = DirectoryStore

0 commit comments

Comments
 (0)