Skip to content

Commit 73cedea

Browse files
authored
Merge branch 'main' into open-typing
2 parents 4d22d4f + cf32382 commit 73cedea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+85
-421
lines changed

.github/workflows/minimal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Setup Miniconda
18-
uses: conda-incubator/setup-miniconda@v2.2.0
18+
uses: conda-incubator/setup-miniconda@v3.0.1
1919
with:
2020
channels: conda-forge
2121
environment-file: environment.yml

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
with:
4343
fetch-depth: 0
4444
- name: Setup Miniconda
45-
uses: conda-incubator/setup-miniconda@v2.2.0
45+
uses: conda-incubator/setup-miniconda@v3.0.1
4646
with:
4747
channels: conda-forge
4848
python-version: ${{ matrix.python-version }}

.github/workflows/releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
with:
6565
name: releases
6666
path: dist
67-
- uses: pypa/[email protected].10
67+
- uses: pypa/[email protected].11
6868
with:
6969
user: __token__
7070
password: ${{ secrets.pypi_password }}

.github/workflows/windows-testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
24-
- uses: conda-incubator/setup-miniconda@v2.2.0
24+
- uses: conda-incubator/setup-miniconda@v3.0.1
2525
with:
2626
auto-update-conda: true
2727
python-version: ${{ matrix.python-version }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ coverage.xml
5151

5252
# Sphinx documentation
5353
docs/_build/
54+
docs/_autoapi/
5455

5556
# PyBuilder
5657
target/

.pre-commit-config.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ repos:
1414
# Respect `exclude` and `extend-exclude` settings.
1515
args: ["--force-exclude"]
1616
- repo: https://github.com/psf/black
17-
rev: 22.12.0
17+
rev: 23.10.1
1818
hooks:
1919
- id: black
2020
- repo: https://github.com/codespell-project/codespell
2121
rev: v2.2.5
2222
hooks:
2323
- id: codespell
24-
args: ["-L", "ba,ihs,kake,nd,noe,nwo,te,fo,zar", "-S", "fixture"]
2524
- repo: https://github.com/pre-commit/pre-commit-hooks
2625
rev: v4.4.0
2726
hooks:

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

bench/compress_normal.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from zarr import blosc
99

1010
if __name__ == "__main__":
11-
1211
sys.path.insert(0, "..")
1312

1413
# setup

docs/api/core.rst

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
The Array class (``zarr.core``)
22
===============================
3-
.. module:: zarr.core
43

5-
.. autoclass:: Array
6-
7-
.. automethod:: __getitem__
8-
.. automethod:: __setitem__
9-
.. automethod:: get_basic_selection
10-
.. automethod:: set_basic_selection
11-
.. automethod:: get_mask_selection
12-
.. automethod:: set_mask_selection
13-
.. automethod:: get_block_selection
14-
.. automethod:: set_block_selection
15-
.. automethod:: get_coordinate_selection
16-
.. automethod:: set_coordinate_selection
17-
.. automethod:: get_orthogonal_selection
18-
.. automethod:: set_orthogonal_selection
19-
.. automethod:: digest
20-
.. automethod:: hexdigest
21-
.. automethod:: resize
22-
.. automethod:: append
23-
.. automethod:: view
24-
.. automethod:: astype
4+
.. automodapi:: zarr.core
5+
:no-heading:

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"sphinx.ext.autosummary",
4343
"sphinx.ext.viewcode",
4444
"sphinx.ext.intersphinx",
45+
"sphinx_automodapi.automodapi",
4546
"numpydoc",
4647
"sphinx_issues",
4748
"sphinx_copybutton",
@@ -52,6 +53,9 @@
5253
numpydoc_class_members_toctree = False
5354
issues_github_path = "zarr-developers/zarr-python"
5455

56+
automodapi_inheritance_diagram = False
57+
automodapi_toctreedirnm = "_autoapi"
58+
5559
# Add any paths that contain templates here, relative to this directory.
5660
templates_path = ["_templates"]
5761

docs/contributing.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ Creating a development environment
8585
To work with the Zarr source code, it is recommended to set up a Python virtual
8686
environment and install all Zarr dependencies using the same versions as are used by
8787
the core developers and continuous integration services. Assuming you have a Python
88-
3 interpreter already installed, and have also installed the virtualenv package, and
89-
you have cloned the Zarr source code and your current working directory is the root of
90-
the repository, you can do something like the following::
88+
3 interpreter already installed, and you have cloned the Zarr source code and your
89+
current working directory is the root of the repository, you can do something like
90+
the following::
9191

9292
$ mkdir -p ~/pyenv/zarr-dev
9393
$ python -m venv ~/pyenv/zarr-dev

docs/release.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,34 @@ Enhancements
2727
Docs
2828
~~~~
2929

30+
* Minor correction and changes in documentation.
31+
By :user:`Sanket Verma <MSanKeys963>` :issue:`1509`.
32+
33+
* Fix typo in documentation.
34+
By :user:`Dimitri Papadopoulos Orfanos <DimitriPapadopoulos>` :issue:`1554`
35+
3036
* The documentation build now fails if there are any warnings.
3137
By :user:`David Stansby <dstansby>` :issue:`1548`.
3238

3339
* Add links to ``numcodecs`` docs in the tutorial.
3440
By :user:`David Stansby <dstansby>` :issue:`1535`.
3541

42+
* Enable offline formats for documentation builds.
43+
By :user:`Sanket Verma <MSanKeys963>` :issue:`1551`.
44+
45+
* Minor tweak to advanced indexing tutorial examples.
46+
By :user:`Ross Barnowski <rossbar>` :issue:`1550`.
47+
48+
3649
Maintenance
3750
~~~~~~~~~~~
3851

52+
* Cache result of ``FSStore._fsspec_installed()``.
53+
By :user:`Janick Martinez Esturo <ph03>` :issue:`1581`.
54+
55+
* Extend copyright notice to 2023.
56+
By :user:`Jack Kelly <JackKelly>` :issue:`1528`.
57+
3958
* Change occurrence of ``io.open()`` into ``open()``.
4059
By :user:`Dimitri Papadopoulos Orfanos <DimitriPapadopoulos>` :issue:`1421`.
4160

@@ -48,6 +67,8 @@ Maintenance
4867
* Allow ``black`` code formatter to be run with any Python version.
4968
By :user:`David Stansby <dstansby>` :issue:`1549`.
5069

70+
* Remove ``sphinx-rtd-theme`` dependency from ``pyproject.toml``.
71+
By :user:`Sanket Verma <MSanKeys963>` :issue:`1563`.
5172

5273

5374
.. _release_2.16.1:

docs/tutorial.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -480,17 +480,17 @@ Indexing with coordinate arrays
480480
Items from a Zarr array can be extracted by providing an integer array of
481481
coordinates. E.g.::
482482

483-
>>> z = zarr.array(np.arange(10))
483+
>>> z = zarr.array(np.arange(10) ** 2)
484484
>>> z[:]
485-
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
486-
>>> z.get_coordinate_selection([1, 4])
487-
array([1, 4])
485+
array([ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81])
486+
>>> z.get_coordinate_selection([2, 5])
487+
array([ 4, 25])
488488

489489
Coordinate arrays can also be used to update data, e.g.::
490490

491-
>>> z.set_coordinate_selection([1, 4], [-1, -2])
491+
>>> z.set_coordinate_selection([2, 5], [-1, -2])
492492
>>> z[:]
493-
array([ 0, -1, 2, 3, -2, 5, 6, 7, 8, 9])
493+
array([ 0, 1, -1, 9, 16, -2, 36, 49, 64, 81])
494494

495495
For multidimensional arrays, coordinates must be provided for each dimension,
496496
e.g.::
@@ -534,17 +534,17 @@ Indexing with a mask array
534534

535535
Items can also be extracted by providing a Boolean mask. E.g.::
536536

537-
>>> z = zarr.array(np.arange(10))
537+
>>> z = zarr.array(np.arange(10) ** 2)
538538
>>> z[:]
539-
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
539+
array([ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81])
540540
>>> sel = np.zeros_like(z, dtype=bool)
541-
>>> sel[1] = True
542-
>>> sel[4] = True
541+
>>> sel[2] = True
542+
>>> sel[5] = True
543543
>>> z.get_mask_selection(sel)
544-
array([1, 4])
544+
array([ 4, 25])
545545
>>> z.set_mask_selection(sel, [-1, -2])
546546
>>> z[:]
547-
array([ 0, -1, 2, 3, -2, 5, 6, 7, 8, 9])
547+
array([ 0, 1, -1, 9, 16, -2, 36, 49, 64, 81])
548548

549549
Here's a multidimensional example::
550550

@@ -986,7 +986,7 @@ It is also possible to initialize the filesystem outside of Zarr and then pass
986986
it through. This requires creating an :class:`zarr.storage.FSStore` object
987987
explicitly. For example::
988988

989-
>>> import s3fs * doctest: +SKIP
989+
>>> import s3fs # doctest: +SKIP
990990
>>> fs = s3fs.S3FileSystem(anon=True) # doctest: +SKIP
991991
>>> store = zarr.storage.FSStore('/zarr-demo/store', fs=fs) # doctest: +SKIP
992992
>>> g = zarr.open_group(store) # doctest: +SKIP

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jupyter = [
4545
]
4646
docs = [
4747
'sphinx',
48+
'sphinx-automodapi',
4849
'sphinx_design',
4950
'sphinx-issues',
5051
'sphinx-copybutton',
@@ -137,3 +138,8 @@ filterwarnings = [
137138
"ignore:PY_SSIZE_T_CLEAN will be required.*:DeprecationWarning",
138139
"ignore:The loop argument is deprecated since Python 3.8.*:DeprecationWarning",
139140
]
141+
142+
143+
[tool.codespell]
144+
ignore-words-list = "ba,ihs,kake,nd,noe,nwo,te,fo,zar"
145+
skip = 'fixture,.git'

requirements_dev_minimal.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# library requirements
22
asciitree==0.3.3
33
fasteners==0.19
4-
numcodecs==0.11.0
4+
numcodecs==0.12.1
55
msgpack-python==0.5.6
66
setuptools-scm==8.0.4
77
# test requirements
8-
pytest==7.4.0
8+
pytest==7.4.3

requirements_dev_optional.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ azure-storage-blob==12.16.0 # pyup: ignore
1111
redis==5.0.1
1212
types-redis
1313
types-setuptools
14-
pymongo==4.5.0
14+
pymongo==4.6.1
1515
# optional test requirements
1616
coverage
1717
pytest-cov==4.1.0
1818
pytest-doctestplus==1.0.0
19-
pytest-timeout==2.1.0
20-
h5py==3.9.0
21-
fsspec==2023.6.0
22-
s3fs==2023.6.0
19+
pytest-timeout==2.2.0
20+
h5py==3.10.0
21+
fsspec==2023.12.1
22+
s3fs==2023.12.1
2323
moto[server]>=4.0.8

zarr/_storage/absstore.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(
8787
"https://{}.blob.core.windows.net/".format(account_name),
8888
container,
8989
credential=account_key,
90-
**blob_service_kwargs
90+
**blob_service_kwargs,
9191
)
9292

9393
self.client = client
@@ -240,7 +240,6 @@ def __setitem__(self, key, value):
240240
super().__setitem__(key, value)
241241

242242
def rmdir(self, path=None):
243-
244243
if not path:
245244
# Currently allowing clear to delete everything as in v2
246245

zarr/_storage/store.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ def _validate_key(self, key: str):
222222
)
223223

224224
if (
225-
not key.startswith("data/")
226-
and (not key.startswith("meta/"))
227-
and (not key == "zarr.json")
225+
not key.startswith(("data/", "meta/"))
226+
and key != "zarr.json"
228227
# TODO: Possibly allow key == ".zmetadata" too if we write a
229228
# consolidated metadata spec corresponding to this?
230229
):
@@ -630,7 +629,6 @@ def _rmdir_from_keys(store: StoreLike, path: Optional[str] = None) -> None:
630629

631630

632631
def _rmdir_from_keys_v3(store: StoreV3, path: str = "") -> None:
633-
634632
meta_dir = meta_root + path
635633
meta_dir = meta_dir.rstrip("/")
636634
_rmdir_from_keys(store, meta_dir)

zarr/_storage/v3.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def _get_files_and_dirs_from_path(store, path):
118118

119119

120120
class FSStoreV3(FSStore, StoreV3):
121-
122121
# FSStoreV3 doesn't use this (FSStore uses it within _normalize_key)
123122
_META_KEYS = ()
124123

0 commit comments

Comments
 (0)