Skip to content

Commit

Permalink
Merge branch 'main' into f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamman authored Dec 7, 2023
2 parents 3bb2aeb + 5954ff9 commit a87025f
Show file tree
Hide file tree
Showing 41 changed files with 75 additions and 409 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.2.0
uses: conda-incubator/setup-miniconda@v3.0.1
with:
channels: conda-forge
environment-file: environment.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
fetch-depth: 0
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.2.0
uses: conda-incubator/setup-miniconda@v3.0.1
with:
channels: conda-forge
python-version: ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
with:
name: releases
path: dist
- uses: pypa/[email protected].10
- uses: pypa/[email protected].11
with:
user: __token__
password: ${{ secrets.pypi_password }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2.2.0
- uses: conda-incubator/setup-miniconda@v3.0.1
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/_autoapi/

# PyBuilder
target/
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
# Respect `exclude` and `extend-exclude` settings.
args: ["--force-exclude"]
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.10.1
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
Expand Down
46 changes: 0 additions & 46 deletions CODE_OF_CONDUCT.md

This file was deleted.

1 change: 0 additions & 1 deletion bench/compress_normal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from zarr import blosc

if __name__ == "__main__":

sys.path.insert(0, "..")

# setup
Expand Down
23 changes: 2 additions & 21 deletions docs/api/core.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
The Array class (``zarr.core``)
===============================
.. module:: zarr.core

.. autoclass:: Array

.. automethod:: __getitem__
.. automethod:: __setitem__
.. automethod:: get_basic_selection
.. automethod:: set_basic_selection
.. automethod:: get_mask_selection
.. automethod:: set_mask_selection
.. automethod:: get_block_selection
.. automethod:: set_block_selection
.. automethod:: get_coordinate_selection
.. automethod:: set_coordinate_selection
.. automethod:: get_orthogonal_selection
.. automethod:: set_orthogonal_selection
.. automethod:: digest
.. automethod:: hexdigest
.. automethod:: resize
.. automethod:: append
.. automethod:: view
.. automethod:: astype
.. automodapi:: zarr.core
:no-heading:
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"sphinx.ext.autosummary",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"sphinx_automodapi.automodapi",
"numpydoc",
"sphinx_issues",
"sphinx_copybutton",
Expand All @@ -52,6 +53,9 @@
numpydoc_class_members_toctree = False
issues_github_path = "zarr-developers/zarr-python"

automodapi_inheritance_diagram = False
automodapi_toctreedirnm = "_autoapi"

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
6 changes: 3 additions & 3 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ Creating a development environment
To work with the Zarr source code, it is recommended to set up a Python virtual
environment and install all Zarr dependencies using the same versions as are used by
the core developers and continuous integration services. Assuming you have a Python
3 interpreter already installed, and have also installed the virtualenv package, and
you have cloned the Zarr source code and your current working directory is the root of
the repository, you can do something like the following::
3 interpreter already installed, and you have cloned the Zarr source code and your
current working directory is the root of the repository, you can do something like
the following::

$ mkdir -p ~/pyenv/zarr-dev
$ python -m venv ~/pyenv/zarr-dev
Expand Down
26 changes: 24 additions & 2 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,33 @@ Unreleased
Docs
~~~~

* Minor correction and changes in documentation.
By :user:`Sanket Verma <MSanKeys963>` :issue:`1509`.

* Fix typo in documentation.
By :user:`Dimitri Papadopoulos Orfanos <DimitriPapadopoulos>` :issue:`1554`

* The documentation build now fails if there are any warnings.
By :user:`David Stansby <dstansby>` :issue:`1548`.

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

* Enable offline formats for documentation builds.
By :user:`Sanket Verma <MSanKeys963>` :issue:`1551`.

* Minor tweak to advanced indexing tutorial examples.
By :user:`Ross Barnowski <rossbar>` :issue:`1550`.


Maintenance
~~~~~~~~~~~

* Change occurrences of % and format() to f-strings.
By :user:`Dimitri Papadopoulos Orfanos <DimitriPapadopoulos>` :issue:`1423`.
* Cache result of ``FSStore._fsspec_installed()``.
By :user:`Janick Martinez Esturo <ph03>` :issue:`1581`.

* Extend copyright notice to 2023.
By :user:`Jack Kelly <JackKelly>` :issue:`1528`.

* Change occurrence of ``io.open()`` into ``open()``.
By :user:`Dimitri Papadopoulos Orfanos <DimitriPapadopoulos>` :issue:`1421`.
Expand All @@ -45,6 +61,12 @@ Maintenance
* Allow ``black`` code formatter to be run with any Python version.
By :user:`David Stansby <dstansby>` :issue:`1549`.

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

* Change occurrences of % and format() to f-strings.
By :user:`Dimitri Papadopoulos Orfanos <DimitriPapadopoulos>` :issue:`1423`.

.. _release_2.16.1:

2.16.1
Expand Down
26 changes: 13 additions & 13 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -480,17 +480,17 @@ Indexing with coordinate arrays
Items from a Zarr array can be extracted by providing an integer array of
coordinates. E.g.::

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

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

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

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

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

>>> z = zarr.array(np.arange(10))
>>> z = zarr.array(np.arange(10) ** 2)
>>> z[:]
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
array([ 0, 1, 4, 9, 16, 25, 36, 49, 64, 81])
>>> sel = np.zeros_like(z, dtype=bool)
>>> sel[1] = True
>>> sel[4] = True
>>> sel[2] = True
>>> sel[5] = True
>>> z.get_mask_selection(sel)
array([1, 4])
array([ 4, 25])
>>> z.set_mask_selection(sel, [-1, -2])
>>> z[:]
array([ 0, -1, 2, 3, -2, 5, 6, 7, 8, 9])
array([ 0, 1, -1, 9, 16, -2, 36, 49, 64, 81])

Here's a multidimensional example::

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

>>> import s3fs * doctest: +SKIP
>>> import s3fs # doctest: +SKIP
>>> fs = s3fs.S3FileSystem(anon=True) # doctest: +SKIP
>>> store = zarr.storage.FSStore('/zarr-demo/store', fs=fs) # doctest: +SKIP
>>> g = zarr.open_group(store) # doctest: +SKIP
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jupyter = [
]
docs = [
'sphinx',
'sphinx-automodapi',
'sphinx_design',
'sphinx-issues',
'sphinx-copybutton',
'sphinx-rtd-theme',
'pydata-sphinx-theme',
'numpydoc',
'numcodecs[msgpack]',
Expand Down
6 changes: 3 additions & 3 deletions requirements_dev_minimal.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# library requirements
asciitree==0.3.3
fasteners==0.19
numcodecs==0.11.0
numcodecs==0.12.1
msgpack-python==0.5.6
setuptools-scm==7.1.0
setuptools-scm==8.0.4
# test requirements
pytest==7.4.0
pytest==7.4.3
12 changes: 6 additions & 6 deletions requirements_dev_optional.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ ipywidgets==8.1.0
# don't let pyup change pinning for azure-storage-blob, need to pin to older
# version to get compatibility with azure storage emulator on appveyor (FIXME)
azure-storage-blob==12.16.0 # pyup: ignore
redis==4.6.0
redis==5.0.1
types-redis
types-setuptools
pymongo==4.5.0
pymongo==4.6.1
# optional test requirements
coverage
pytest-cov==4.1.0
pytest-doctestplus==1.0.0
pytest-timeout==2.1.0
h5py==3.9.0
fsspec==2023.6.0
s3fs==2023.6.0
pytest-timeout==2.2.0
h5py==3.10.0
fsspec==2023.10.0
s3fs==2023.10.0
moto[server]>=4.0.8
1 change: 0 additions & 1 deletion zarr/_storage/absstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def __setitem__(self, key, value):
super().__setitem__(key, value)

def rmdir(self, path=None):

if not path:
# Currently allowing clear to delete everything as in v2

Expand Down
6 changes: 2 additions & 4 deletions zarr/_storage/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,8 @@ def _validate_key(self, key: str):
)

if (
not key.startswith("data/")
and (not key.startswith("meta/"))
and (not key == "zarr.json")
not key.startswith(("data/", "meta/"))
and key != "zarr.json"
# TODO: Possibly allow key == ".zmetadata" too if we write a
# consolidated metadata spec corresponding to this?
):
Expand Down Expand Up @@ -629,7 +628,6 @@ def _rmdir_from_keys(store: StoreLike, path: Optional[str] = None) -> None:


def _rmdir_from_keys_v3(store: StoreV3, path: str = "") -> None:

meta_dir = meta_root + path
meta_dir = meta_dir.rstrip("/")
_rmdir_from_keys(store, meta_dir)
Expand Down
1 change: 0 additions & 1 deletion zarr/_storage/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def _get_files_and_dirs_from_path(store, path):


class FSStoreV3(FSStore, StoreV3):

# FSStoreV3 doesn't use this (FSStore uses it within _normalize_key)
_META_KEYS = ()

Expand Down
Loading

0 comments on commit a87025f

Please sign in to comment.