Skip to content

Commit 912e582

Browse files
committed
Merge remott e-tracking branch 'refs/remotes/origin/tom/fix/cm-nested-getitem' into tom/fix/cm-nested-getitem
2 parents a0c0ef6 + b08917c commit 912e582

File tree

17 files changed

+740
-457
lines changed

17 files changed

+740
-457
lines changed

.github/workflows/gpu_test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: GPU Test V3
4+
name: GPU Test
55

66
on:
77
push:
8-
branches: [ v3 ]
8+
branches: [ main ]
99
pull_request:
10-
branches: [ v3 ]
10+
branches: [ main ]
1111
workflow_dispatch:
1212

1313
env:

.github/workflows/hypothesis.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ on:
33
push:
44
branches:
55
- "main"
6-
- "v3"
76
pull_request:
87
branches:
98
- "main"
10-
- "v3"
119
types: [opened, reopened, synchronize, labeled]
1210
schedule:
1311
- cron: "0 0 * * *" # Daily “At 00:00” UTC

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Test V3
4+
name: Test
55

66
on:
77
push:
8-
branches: [ v3 ]
8+
branches: [ main ]
99
pull_request:
10-
branches: [ v3 ]
10+
branches: [ main ]
1111
workflow_dispatch:
1212

1313
concurrency:

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
from importlib.metadata import version as get_version
2323

24-
import zarr
2524
import sphinx
2625

2726
# If extensions (or modules to document with autodoc) are in another directory,

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Zarr-Python
1616
release
1717
license
1818
contributing
19+
roadmap
1920

2021
**Version**: |version|
2122

docs/roadmap.rst

Lines changed: 696 additions & 0 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ extend-select = [
211211
"B", # flake8-bugbear
212212
"C4", # flake8-comprehensions
213213
"FLY", # flynt
214+
"G", # flake8-logging-format
214215
"I", # isort
215216
"ISC", # flake8-implicit-str-concat
216217
"PGH", # pygrep-hooks
@@ -222,20 +223,24 @@ extend-select = [
222223
"TCH", # flake8-type-checking
223224
"TRY", # tryceratops
224225
"UP", # pyupgrade
226+
"W", # pycodestyle warnings
225227
]
226228
ignore = [
227229
"ANN003",
228230
"ANN101",
229231
"ANN102",
230232
"ANN401",
231233
"PT004", # deprecated
234+
"PT005", # deprecated
232235
"PT011", # TODO: apply this rule
233236
"PT012", # TODO: apply this rule
234237
"PYI013",
235238
"RET505",
236239
"RET506",
237240
"RUF005",
238241
"TRY003",
242+
"UP027", # deprecated
243+
"UP038", # https://github.com/astral-sh/ruff/issues/7871
239244
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
240245
"W191",
241246
"E111",

src/zarr/abc/store.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from abc import ABC, abstractmethod
44
from asyncio import gather
5-
from types import TracebackType
65
from typing import TYPE_CHECKING, NamedTuple, Protocol, runtime_checkable
76

87
if TYPE_CHECKING:

src/zarr/core/group.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,11 @@ async def create_array(
981981

982982
@deprecated("Use AsyncGroup.create_array instead.")
983983
async def create_dataset(
984-
self, name: str, **kwargs: Any
984+
self,
985+
name: str,
986+
*,
987+
shape: ShapeLike,
988+
**kwargs: Any,
985989
) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]:
986990
"""Create an array.
987991
@@ -992,6 +996,8 @@ async def create_dataset(
992996
----------
993997
name : str
994998
Array name.
999+
shape : int or tuple of ints
1000+
Array shape.
9951001
kwargs : dict
9961002
Additional arguments passed to :func:`zarr.AsyncGroup.create_array`.
9971003
@@ -1002,7 +1008,7 @@ async def create_dataset(
10021008
.. deprecated:: 3.0.0
10031009
The h5py compatibility methods will be removed in 3.1.0. Use `AsyncGroup.create_array` instead.
10041010
"""
1005-
return await self.create_array(name, **kwargs)
1011+
return await self.create_array(name, shape=shape, **kwargs)
10061012

10071013
@deprecated("Use AsyncGroup.require_array instead.")
10081014
async def require_dataset(
@@ -1705,7 +1711,13 @@ def create_dataset(self, name: str, **kwargs: Any) -> Array:
17051711
return Array(self._sync(self._async_group.create_dataset(name, **kwargs)))
17061712

17071713
@deprecated("Use Group.require_array instead.")
1708-
def require_dataset(self, name: str, **kwargs: Any) -> Array:
1714+
def require_dataset(
1715+
self,
1716+
name: str,
1717+
*,
1718+
shape: ShapeLike,
1719+
**kwargs: Any,
1720+
) -> Array:
17091721
"""Obtain an array, creating if it doesn't exist.
17101722
17111723
Arrays are known as "datasets" in HDF5 terminology. For compatibility
@@ -1732,9 +1744,15 @@ def require_dataset(self, name: str, **kwargs: Any) -> Array:
17321744
.. deprecated:: 3.0.0
17331745
The h5py compatibility methods will be removed in 3.1.0. Use `Group.require_array` instead.
17341746
"""
1735-
return Array(self._sync(self._async_group.require_array(name, **kwargs)))
1747+
return Array(self._sync(self._async_group.require_array(name, shape=shape, **kwargs)))
17361748

1737-
def require_array(self, name: str, **kwargs: Any) -> Array:
1749+
def require_array(
1750+
self,
1751+
name: str,
1752+
*,
1753+
shape: ShapeLike,
1754+
**kwargs: Any,
1755+
) -> Array:
17381756
"""Obtain an array, creating if it doesn't exist.
17391757
17401758
@@ -1756,7 +1774,7 @@ def require_array(self, name: str, **kwargs: Any) -> Array:
17561774
-------
17571775
a : Array
17581776
"""
1759-
return Array(self._sync(self._async_group.require_array(name, **kwargs)))
1777+
return Array(self._sync(self._async_group.require_array(name, shape=shape, **kwargs)))
17601778

17611779
def empty(self, *, name: str, shape: ChunkCoords, **kwargs: Any) -> Array:
17621780
return Array(self._sync(self._async_group.empty(name=name, shape=shape, **kwargs)))

src/zarr/core/sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def sync(
133133

134134
finished, unfinished = wait([future], return_when=asyncio.ALL_COMPLETED, timeout=timeout)
135135
if len(unfinished) > 0:
136-
raise TimeoutError(f"Coroutine {coro} failed to finish in within {timeout}s")
136+
raise TimeoutError(f"Coroutine {coro} failed to finish within {timeout} s")
137137
assert len(finished) == 1
138138
return_result = next(iter(finished)).result()
139139

0 commit comments

Comments
 (0)