Skip to content

Commit 0e4cc7e

Browse files
chore(deps): drop support for python 3.10 and numpy 1.24 (zarr-developers#2217)
* chore(deps): drop support for python 3.10 and numpy 124 * lint * bump python in readthedocs * fix array import in docs * try on 3.12 * style: pre-commit fixes * fixup --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6984294 commit 0e4cc7e

26 files changed

+70
-79
lines changed

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
runs-on: ubuntu-latest
2222
strategy:
2323
matrix:
24-
python-version: ['3.10', '3.11', '3.12']
25-
numpy-version: ['1.24', '1.26', '2.0']
24+
python-version: ['3.11', '3.12']
25+
numpy-version: ['1.25', '1.26', '2.0']
2626
dependency-set: ["minimal", "optional"]
2727

2828
steps:

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.10"
6+
python: "3.12"
77

88
sphinx:
99
configuration: docs/conf.py

docs/release.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ Documentation
11421142
* Update docs to use ``python -m pytest``.
11431143
By :user:`Ray Bell <raybellwaves>` :issue:`923`.
11441144

1145-
* Fix versionadded tag in zarr.core.Array docstring.
1145+
* Fix versionadded tag in zarr.Array docstring.
11461146
By :user:`Juan Nunez-Iglesias <jni>` :issue:`852`.
11471147

11481148
* Doctest seem to be stricter now, updating tostring() to tobytes().
@@ -1896,7 +1896,7 @@ Enhancements
18961896
:user:`John Kirkham <jakirkham>`, :issue:`92`, :issue:`122`.
18971897

18981898
* **Viewing an array as a different dtype**. The ``Array`` class has a new
1899-
:func:`zarr.core.Array.astype` method, which is a convenience that enables an
1899+
:func:`zarr.Array.astype` method, which is a convenience that enables an
19001900
array to be viewed as a different dtype. By :user:`John Kirkham <jakirkham>`,
19011901
:issue:`94`, :issue:`96`.
19021902

docs/tutorial.rst

+25-25
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Zarr has several functions for creating arrays. For example::
1818
>>> import zarr
1919
>>> z = zarr.zeros((10000, 10000), chunks=(1000, 1000), dtype='i4')
2020
>>> z
21-
<zarr.core.Array (10000, 10000) int32>
21+
<zarr.Array (10000, 10000) int32>
2222

2323
The code above creates a 2-dimensional array of 32-bit integers with 10000 rows
2424
and 10000 columns, divided into chunks where each chunk has 1000 rows and 1000
@@ -168,7 +168,7 @@ compression ratio. Zarr arrays provide a ``info`` property which can be used to
168168
print some diagnostics, e.g.::
169169

170170
>>> z.info
171-
Type : zarr.core.Array
171+
Type : zarr.Array
172172
Data type : int32
173173
Shape : (10000, 10000)
174174
Chunk shape : (1000, 1000)
@@ -260,7 +260,7 @@ Here is an example using a delta filter with the Blosc compressor::
260260
>>> data = np.arange(100000000, dtype='i4').reshape(10000, 10000)
261261
>>> z = zarr.array(data, chunks=(1000, 1000), filters=filters, compressor=compressor)
262262
>>> z.info
263-
Type : zarr.core.Array
263+
Type : zarr.Array
264264
Data type : int32
265265
Shape : (10000, 10000)
266266
Chunk shape : (1000, 1000)
@@ -302,15 +302,15 @@ Groups can also contain arrays, e.g.::
302302

303303
>>> z1 = bar.zeros('baz', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4')
304304
>>> z1
305-
<zarr.core.Array '/foo/bar/baz' (10000, 10000) int32>
305+
<zarr.Array '/foo/bar/baz' (10000, 10000) int32>
306306

307307
Arrays are known as "datasets" in HDF5 terminology. For compatibility with h5py,
308308
Zarr groups also implement the ``create_dataset()`` and ``require_dataset()``
309309
methods, e.g.::
310310

311311
>>> z = bar.create_dataset('quux', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4')
312312
>>> z
313-
<zarr.core.Array '/foo/bar/quux' (10000, 10000) int32>
313+
<zarr.Array '/foo/bar/quux' (10000, 10000) int32>
314314

315315
Members of a group can be accessed via the suffix notation, e.g.::
316316

@@ -323,7 +323,7 @@ call, e.g.::
323323
>>> root['foo/bar']
324324
<zarr.hierarchy.Group '/foo/bar'>
325325
>>> root['foo/bar/baz']
326-
<zarr.core.Array '/foo/bar/baz' (10000, 10000) int32>
326+
<zarr.Array '/foo/bar/baz' (10000, 10000) int32>
327327

328328
The :func:`zarr.hierarchy.Group.tree` method can be used to print a tree
329329
representation of the hierarchy, e.g.::
@@ -344,7 +344,7 @@ sub-directories, e.g.::
344344
<zarr.hierarchy.Group '/'>
345345
>>> z = root.zeros('foo/bar/baz', shape=(10000, 10000), chunks=(1000, 1000), dtype='i4')
346346
>>> z
347-
<zarr.core.Array '/foo/bar/baz' (10000, 10000) int32>
347+
<zarr.Array '/foo/bar/baz' (10000, 10000) int32>
348348

349349
Groups can be used as context managers (in a ``with`` statement).
350350
If the underlying store has a ``close`` method, it will be called on exit.
@@ -388,7 +388,7 @@ property. E.g.::
388388

389389
>>> bar.info
390390
Name : /foo/bar
391-
Type : zarr.core.Array
391+
Type : zarr.Array
392392
Data type : int64
393393
Shape : (1000000,)
394394
Chunk shape : (100000,)
@@ -403,7 +403,7 @@ property. E.g.::
403403

404404
>>> baz.info
405405
Name : /foo/baz
406-
Type : zarr.core.Array
406+
Type : zarr.Array
407407
Data type : float32
408408
Shape : (1000, 1000)
409409
Chunk shape : (100, 100)
@@ -472,7 +472,7 @@ Note that although this functionality is similar to some of the advanced
472472
indexing capabilities available on NumPy arrays and on h5py datasets, **the Zarr
473473
API for advanced indexing is different from both NumPy and h5py**, so please
474474
read this section carefully. For a complete description of the indexing API,
475-
see the documentation for the :class:`zarr.core.Array` class.
475+
see the documentation for the :class:`zarr.Array` class.
476476

477477
Indexing with coordinate arrays
478478
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -880,10 +880,10 @@ Here is an example using S3Map to read an array created previously::
880880
>>> root = zarr.group(store=store)
881881
>>> z = root['foo/bar/baz']
882882
>>> z
883-
<zarr.core.Array '/foo/bar/baz' (21,) |S1>
883+
<zarr.Array '/foo/bar/baz' (21,) |S1>
884884
>>> z.info
885885
Name : /foo/bar/baz
886-
Type : zarr.core.Array
886+
Type : zarr.Array
887887
Data type : |S1
888888
Shape : (21,)
889889
Chunk shape : (7,)
@@ -1150,7 +1150,7 @@ your array, then you can use an array with a fixed-length bytes dtype. E.g.::
11501150

11511151
>>> z = zarr.zeros(10, dtype='S6')
11521152
>>> z
1153-
<zarr.core.Array (10,) |S6>
1153+
<zarr.Array (10,) |S6>
11541154
>>> z[0] = b'Hello'
11551155
>>> z[1] = b'world!'
11561156
>>> z[:]
@@ -1166,7 +1166,7 @@ A fixed-length unicode dtype is also available, e.g.::
11661166
>>> text_data = greetings * 10000
11671167
>>> z = zarr.array(text_data, dtype='U20')
11681168
>>> z
1169-
<zarr.core.Array (120000,) <U20>
1169+
<zarr.Array (120000,) <U20>
11701170
>>> z[:]
11711171
array(['¡Hola mundo!', 'Hej Världen!', 'Servus Woid!', ...,
11721172
'Helló, világ!', 'Zdravo svete!', 'เฮลโลเวิลด์'],
@@ -1182,7 +1182,7 @@ E.g. using ``VLenUTF8``::
11821182
>>> import numcodecs
11831183
>>> z = zarr.array(text_data, dtype=object, object_codec=numcodecs.VLenUTF8())
11841184
>>> z
1185-
<zarr.core.Array (120000,) object>
1185+
<zarr.Array (120000,) object>
11861186
>>> z.filters
11871187
[VLenUTF8()]
11881188
>>> z[:]
@@ -1194,7 +1194,7 @@ is a short-hand for ``dtype=object, object_codec=numcodecs.VLenUTF8()``, e.g.::
11941194

11951195
>>> z = zarr.array(text_data, dtype=str)
11961196
>>> z
1197-
<zarr.core.Array (120000,) object>
1197+
<zarr.Array (120000,) object>
11981198
>>> z.filters
11991199
[VLenUTF8()]
12001200
>>> z[:]
@@ -1210,7 +1210,7 @@ e.g.::
12101210
>>> bytes_data = [g.encode('utf-8') for g in greetings] * 10000
12111211
>>> z = zarr.array(bytes_data, dtype=bytes)
12121212
>>> z
1213-
<zarr.core.Array (120000,) object>
1213+
<zarr.Array (120000,) object>
12141214
>>> z.filters
12151215
[VLenBytes()]
12161216
>>> z[:]
@@ -1225,7 +1225,7 @@ integer. E.g.::
12251225
>>> categorize = numcodecs.Categorize(greetings, dtype=object)
12261226
>>> z = zarr.array(text_data, dtype=object, object_codec=categorize)
12271227
>>> z
1228-
<zarr.core.Array (120000,) object>
1228+
<zarr.Array (120000,) object>
12291229
>>> z.filters
12301230
[Categorize(dtype='|O', astype='|u1', labels=['¡Hola mundo!', 'Hej Världen!', 'Servus Woid!', ...])]
12311231
>>> z[:]
@@ -1275,7 +1275,7 @@ and stores the same primitive type (a.k.a. a ragged array), the
12751275

12761276
>>> z = zarr.empty(4, dtype=object, object_codec=numcodecs.VLenArray(int))
12771277
>>> z
1278-
<zarr.core.Array (4,) object>
1278+
<zarr.Array (4,) object>
12791279
>>> z.filters
12801280
[VLenArray(dtype='<i8')]
12811281
>>> z[0] = np.array([1, 3, 5])
@@ -1291,7 +1291,7 @@ primitive dtype such as 'i4' or 'f8'. E.g.::
12911291

12921292
>>> z = zarr.empty(4, dtype='array:i8')
12931293
>>> z
1294-
<zarr.core.Array (4,) object>
1294+
<zarr.Array (4,) object>
12951295
>>> z.filters
12961296
[VLenArray(dtype='<i8')]
12971297
>>> z[0] = np.array([1, 3, 5])
@@ -1367,7 +1367,7 @@ ratios, depending on the correlation structure within the data. E.g.::
13671367
>>> a = np.arange(100000000, dtype='i4').reshape(10000, 10000).T
13681368
>>> c = zarr.array(a, chunks=(1000, 1000))
13691369
>>> c.info
1370-
Type : zarr.core.Array
1370+
Type : zarr.Array
13711371
Data type : int32
13721372
Shape : (10000, 10000)
13731373
Chunk shape : (1000, 1000)
@@ -1381,7 +1381,7 @@ ratios, depending on the correlation structure within the data. E.g.::
13811381
Chunks initialized : 100/100
13821382
>>> f = zarr.array(a, chunks=(1000, 1000), order='F')
13831383
>>> f.info
1384-
Type : zarr.core.Array
1384+
Type : zarr.Array
13851385
Data type : int32
13861386
Shape : (10000, 10000)
13871387
Chunk shape : (1000, 1000)
@@ -1549,7 +1549,7 @@ with thread synchronization::
15491549
>>> z = zarr.zeros((10000, 10000), chunks=(1000, 1000), dtype='i4',
15501550
... synchronizer=zarr.ThreadSynchronizer())
15511551
>>> z
1552-
<zarr.core.Array (10000, 10000) int32>
1552+
<zarr.Array (10000, 10000) int32>
15531553

15541554
This array is safe to read or write within a multi-threaded program.
15551555

@@ -1563,7 +1563,7 @@ some networked file systems). E.g.::
15631563
... chunks=(1000, 1000), dtype='i4',
15641564
... synchronizer=synchronizer)
15651565
>>> z
1566-
<zarr.core.Array (10000, 10000) int32>
1566+
<zarr.Array (10000, 10000) int32>
15671567

15681568
This array is safe to read or write from multiple processes.
15691569

@@ -1631,7 +1631,7 @@ arrays, as long as the units are specified. E.g.::
16311631

16321632
>>> z = zarr.array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='M8[D]')
16331633
>>> z
1634-
<zarr.core.Array (3,) datetime64[D]>
1634+
<zarr.Array (3,) datetime64[D]>
16351635
>>> z[:]
16361636
array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='datetime64[D]')
16371637
>>> z[0]

pyproject.toml

+12-13
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ maintainers = [
2020
{ name = "Norman Rzepka" },
2121
{ name = "Ryan Abernathey" }
2222
]
23-
requires-python = ">=3.10"
23+
requires-python = ">=3.11"
2424
# If you add a new dependency here, please also add it to .pre-commit-config.yml
2525
dependencies = [
2626
'asciitree',
27-
'numpy>=1.24',
27+
'numpy>=1.25',
2828
'fasteners',
29-
'numcodecs>=0.10.0',
29+
'numcodecs>=0.10.2',
3030
'fsspec>2024',
3131
'crc32c',
3232
'typing_extensions',
@@ -45,7 +45,6 @@ classifiers = [
4545
'Topic :: Software Development :: Libraries :: Python Modules',
4646
'Operating System :: Unix',
4747
'Programming Language :: Python :: 3',
48-
'Programming Language :: Python :: 3.10',
4948
'Programming Language :: Python :: 3.11',
5049
'Programming Language :: Python :: 3.12',
5150
]
@@ -130,18 +129,18 @@ dependencies = [
130129
features = ["test", "extra"]
131130

132131
[[tool.hatch.envs.test.matrix]]
133-
python = ["3.10", "3.11", "3.12"]
134-
numpy = ["1.24", "1.26", "2.0"]
132+
python = ["3.11", "3.12"]
133+
numpy = ["1.25", "1.26", "2.0"]
135134
version = ["minimal"]
136135

137136
[[tool.hatch.envs.test.matrix]]
138-
python = ["3.10", "3.11", "3.12"]
139-
numpy = ["1.24", "1.26", "2.0"]
137+
python = ["3.11", "3.12"]
138+
numpy = ["1.25", "1.26", "2.0"]
140139
features = ["optional"]
141140

142141
[[tool.hatch.envs.test.matrix]]
143-
python = ["3.10", "3.11", "3.12"]
144-
numpy = ["1.24", "1.26", "2.0"]
142+
python = ["3.11", "3.12"]
143+
numpy = ["1.25", "1.26", "2.0"]
145144
features = ["gpu"]
146145

147146
[tool.hatch.envs.test.scripts]
@@ -161,8 +160,8 @@ dependencies = [
161160
features = ["test", "extra", "gpu"]
162161

163162
[[tool.hatch.envs.gputest.matrix]]
164-
python = ["3.10", "3.11", "3.12"]
165-
numpy = ["1.24", "1.26", "2.0"]
163+
python = ["3.11", "3.12"]
164+
numpy = ["1.25", "1.26", "2.0"]
166165
version = ["minimal"]
167166

168167
[tool.hatch.envs.gputest.scripts]
@@ -249,7 +248,7 @@ ignore = [
249248
]
250249

251250
[tool.mypy]
252-
python_version = "3.10"
251+
python_version = "3.11"
253252
ignore_missing_imports = true
254253
namespace_packages = false
255254

src/zarr/abc/codec.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
if TYPE_CHECKING:
1212
from collections.abc import Awaitable, Callable, Iterable
13+
from typing import Self
1314

1415
import numpy as np
15-
from typing_extensions import Self
1616

1717
from zarr.abc.store import ByteGetter, ByteSetter
1818
from zarr.core.array_spec import ArraySpec

src/zarr/abc/metadata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import TYPE_CHECKING
55

66
if TYPE_CHECKING:
7-
from typing_extensions import Self
7+
from typing import Self
88

99
from zarr.core.common import JSON
1010

src/zarr/abc/store.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
from abc import ABC, abstractmethod
44
from asyncio import gather
55
from collections.abc import AsyncGenerator, Iterable
6+
from types import TracebackType
67
from typing import TYPE_CHECKING, Any, NamedTuple, Protocol, runtime_checkable
78

89
if TYPE_CHECKING:
910
from collections.abc import AsyncGenerator, Iterable
1011
from types import TracebackType
11-
from typing import Any, TypeAlias
12-
13-
from typing_extensions import Self
12+
from typing import Any, Self, TypeAlias
1413

1514
from zarr.core.buffer import Buffer, BufferPrototype
1615
from zarr.core.common import AccessModeLiteral, BytesLike

src/zarr/codecs/blosc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from zarr.registry import register_codec
1515

1616
if TYPE_CHECKING:
17-
from typing_extensions import Self
17+
from typing import Self
1818

1919
from zarr.core.array_spec import ArraySpec
2020
from zarr.core.buffer import Buffer

src/zarr/codecs/bytes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from zarr.registry import register_codec
1414

1515
if TYPE_CHECKING:
16-
from typing_extensions import Self
16+
from typing import Self
1717

1818
from zarr.core.array_spec import ArraySpec
1919

src/zarr/codecs/crc32c_.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from zarr.registry import register_codec
1313

1414
if TYPE_CHECKING:
15-
from typing_extensions import Self
15+
from typing import Self
1616

1717
from zarr.core.array_spec import ArraySpec
1818
from zarr.core.buffer import Buffer

0 commit comments

Comments
 (0)