Skip to content

Commit 9e12ae4

Browse files
committed
Merge branch 'main' of https://github.com/zarr-developers/zarr-python into docs/3.0-dev-guide
2 parents da01023 + 23beb8f commit 9e12ae4

Some content is hidden

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

77 files changed

+4012
-1996
lines changed

.github/workflows/test.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,38 @@ jobs:
9494
run: |
9595
hatch env run --env ${{ matrix.dependency-set }} run
9696
97+
doctests:
98+
name: doctests
99+
runs-on: ubuntu-latest
100+
steps:
101+
- uses: actions/checkout@v4
102+
with:
103+
fetch-depth: 0 # required for hatch version discovery, which is needed for numcodecs.zarr3
104+
- name: Set up Python
105+
uses: actions/setup-python@v5
106+
with:
107+
python-version: '3.13'
108+
cache: 'pip'
109+
- name: Install Hatch
110+
run: |
111+
python -m pip install --upgrade pip
112+
pip install hatch
113+
- name: Set Up Hatch Env
114+
run: |
115+
hatch env create doctest
116+
hatch env run -e doctest list-env
117+
- name: Run Tests
118+
run: |
119+
hatch env run --env doctest run
120+
97121
test-complete:
98122
name: Test complete
99123

100124
needs:
101125
[
102126
test,
103127
test-upstream-and-min-deps,
128+
doctests
104129
]
105130
if: always()
106131
runs-on: ubuntu-latest
@@ -111,4 +136,4 @@ jobs:
111136
contains(needs.*.result, 'cancelled')
112137
run: exit 1
113138
- name: Success
114-
run: echo Success!
139+
run: echo Success!

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ docs/_build/
5454
docs/_autoapi
5555
docs/data
5656
data
57+
data.zip
5758

5859
# PyBuilder
5960
target/

docs/about.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
About
2+
=====
3+
4+
Zarr is a format for the storage of chunked, compressed, N-dimensional arrays
5+
inspired by `HDF5 <https://www.hdfgroup.org/HDF5/>`_, `h5py
6+
<https://www.h5py.org/>`_ and `bcolz <https://bcolz.readthedocs.io/>`_.
7+
8+
These documents describe the Zarr-Python implementation. More information
9+
about the Zarr format can be found on the `main website <https://zarr.dev>`_.
10+
11+
Projects using Zarr
12+
-------------------
13+
14+
If you are using Zarr-Python, we would `love to hear about it
15+
<https://github.com/zarr-developers/community/issues/19>`_.
16+
17+
Funding
18+
-------
19+
The project is fiscally sponsored by `NumFOCUS <https://numfocus.org/>`_, a US
20+
501(c)(3) public charity, and development is supported by the
21+
`MRC Centre for Genomics and Global Health <https://www.cggh.org>`_
22+
and the `Chan Zuckerberg Initiative <https://chanzuckerberg.com/>`_.
23+
24+
.. _NumCodecs: https://numcodecs.readthedocs.io/

docs/conf.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import sys
1818
from typing import Any
1919

20+
import sphinx
2021
import sphinx.application
2122

2223
from importlib.metadata import version as get_version
@@ -48,8 +49,6 @@
4849
"sphinx_copybutton",
4950
"sphinx_design",
5051
'sphinx_reredirects',
51-
"IPython.sphinxext.ipython_directive",
52-
"IPython.sphinxext.ipython_console_highlighting",
5352
]
5453

5554
issues_github_path = "zarr-developers/zarr-python"
@@ -62,6 +61,20 @@
6261
autoapi_keep_files = True
6362
autoapi_options = [ 'members', 'undoc-members', 'show-inheritance', 'show-module-summary', 'imported-members', ]
6463

64+
def skip_submodules(
65+
app: sphinx.application.Sphinx,
66+
what: str,
67+
name: str,
68+
obj: object,
69+
skip: bool,
70+
options: dict[str, Any]
71+
) -> bool:
72+
# Skip documenting zarr.codecs submodules
73+
# codecs are documented in the main zarr.codecs namespace
74+
if what == "module" and name.startswith("zarr.codecs."):
75+
skip = True
76+
return skip
77+
6578
# Add any paths that contain templates here, relative to this directory.
6679
templates_path = ["_templates"]
6780

@@ -91,6 +104,7 @@
91104
"spec/v3": "https://zarr-specs.readthedocs.io/en/latest/v3/core/v3.0.html",
92105
"license": "https://github.com/zarr-developers/zarr-python/blob/main/LICENSE.txt",
93106
"tutorial": "user-guide",
107+
"getting-started": "quickstart",
94108
"release": "developers/release.html",
95109
"roadmap": "developers/roadmap.html",
96110
}
@@ -184,6 +198,7 @@
184198

185199
def setup(app: sphinx.application.Sphinx) -> None:
186200
app.add_css_file("custom.css")
201+
app.connect("autoapi-skip-member", skip_submodules)
187202

188203

189204
# The name of an image file (relative to this directory) to use as a favicon of

docs/developers/release.rst

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ Enhancements
19061906

19071907
* **Advanced indexing**. The ``Array`` class has several new methods and
19081908
properties that enable a selection of items in an array to be retrieved or
1909-
updated. See the :ref:`tutorial_indexing` tutorial section for more
1909+
updated. See the :ref:`user-guide-indexing` tutorial section for more
19101910
information. There is also a `notebook
19111911
<https://github.com/zarr-developers/zarr-python/blob/main/notebooks/advanced_indexing.ipynb>`_
19121912
with extended examples and performance benchmarks. :issue:`78`, :issue:`89`,
@@ -1919,15 +1919,15 @@ Enhancements
19191919
compressor codecs for Zstd and LZ4. This change is backwards-compatible with
19201920
existing code, as all codec classes defined by Numcodecs are imported into the
19211921
:mod:`zarr.codecs` namespace. However, it is recommended to import codecs from
1922-
the new package, see the tutorial sections on :ref:`tutorial_compress` and
1923-
:ref:`tutorial_filters` for examples. With contributions by
1922+
the new package, see the tutorial sections on :ref:`user-guide-compress` and
1923+
:ref:`user-guide-filters` for examples. With contributions by
19241924
:user:`John Kirkham <jakirkham>`; :issue:`74`, :issue:`102`, :issue:`120`,
19251925
:issue:`123`, :issue:`139`.
19261926

19271927
* **New storage class for DBM-style databases**. The
19281928
:class:`zarr.storage.DBMStore` class enables any DBM-style database such as gdbm,
19291929
ndbm or Berkeley DB, to be used as the backing store for an array or group. See the
1930-
tutorial section on :ref:`tutorial_storage` for some examples. :issue:`133`,
1930+
tutorial section on :ref:`user-guide-storage` for some examples. :issue:`133`,
19311931
:issue:`186`.
19321932

19331933
* **New storage class for LMDB databases**. The :class:`zarr.storage.LMDBStore` class
@@ -1943,7 +1943,7 @@ Enhancements
19431943
:func:`zarr.hierarchy.Group.tree` method which enables a tree representation of
19441944
a group hierarchy to be printed. Also provides an interactive tree
19451945
representation when used within a Jupyter notebook. See the
1946-
:ref:`tutorial_diagnostics` tutorial section for examples. By
1946+
:ref:`user-guide-diagnostics` tutorial section for examples. By
19471947
:user:`John Kirkham <jakirkham>`; :issue:`82`, :issue:`140`, :issue:`184`.
19481948

19491949
* **Visitor API**. The ``Group`` class now implements the h5py visitor API, see
@@ -1963,7 +1963,7 @@ Enhancements
19631963
store. The functions :func:`zarr.convenience.save` and
19641964
:func:`zarr.convenience.load` are also available and provide a convenient way to
19651965
save an entire NumPy array to disk and load back into memory later. See the
1966-
tutorial section :ref:`tutorial_persist` for examples. :issue:`104`,
1966+
tutorial section :ref:`user-guide-persist` for examples. :issue:`104`,
19671967
:issue:`105`, :issue:`141`, :issue:`181`.
19681968

19691969
* **IPython completions**. The ``Group`` class now implements ``__dir__()`` and
@@ -1973,15 +1973,15 @@ Enhancements
19731973
* **New info property; changes to __repr__**. The ``Group`` and
19741974
``Array`` classes have a new ``info`` property which can be used to print
19751975
diagnostic information, including compression ratio where available. See the
1976-
tutorial section on :ref:`tutorial_diagnostics` for examples. The string
1976+
tutorial section on :ref:`user-guide-diagnostics` for examples. The string
19771977
representation (``__repr__``) of these classes has been simplified to ensure
19781978
it is cheap and quick to compute in all circumstances. :issue:`83`,
19791979
:issue:`115`, :issue:`132`, :issue:`148`.
19801980

19811981
* **Chunk options**. When creating an array, ``chunks=False`` can be specified,
19821982
which will result in an array with a single chunk only. Alternatively,
19831983
``chunks=True`` will trigger an automatic chunk shape guess. See
1984-
:ref:`tutorial_chunks` for more on the ``chunks`` parameter. :issue:`106`,
1984+
:ref:`user-guide-chunks` for more on the ``chunks`` parameter. :issue:`106`,
19851985
:issue:`107`, :issue:`183`.
19861986

19871987
* **Zero-dimensional arrays** and are now supported; by
@@ -2006,7 +2006,7 @@ Enhancements
20062006
creating an array with ``dtype=object`` was possible but could under certain
20072007
circumstances lead to unexpected errors and/or segmentation faults. To make it easier
20082008
to properly configure an object array, a new ``object_codec`` parameter has been
2009-
added to array creation functions. See the tutorial section on :ref:`tutorial_objects`
2009+
added to array creation functions. See the tutorial section on :ref:`user-guide-objects`
20102010
for more information and examples. Also, runtime checks have been added in both Zarr
20112011
and Numcodecs so that segmentation faults are no longer possible, even with a badly
20122012
configured array. This API change is backwards compatible and previous code that created
@@ -2062,16 +2062,16 @@ Documentation
20622062
with any of the material as previously implemented, and so the changes have been made
20632063
in-place in the document without incrementing the document version number. See the
20642064
section on changes in the specification document for more information.
2065-
* A new :ref:`tutorial_indexing` section has been added to the tutorial.
2066-
* A new :ref:`tutorial_strings` section has been added to the tutorial
2065+
* A new :ref:`user-guide-indexing` section has been added to the tutorial.
2066+
* A new :ref:`user-guide-strings` section has been added to the tutorial
20672067
(:issue:`135`, :issue:`175`).
2068-
* The :ref:`tutorial_chunks` tutorial section has been reorganised and updated.
2069-
* The :ref:`tutorial_persist` and :ref:`tutorial_storage` tutorial sections have
2068+
* The :ref:`user-guide-chunks` tutorial section has been reorganised and updated.
2069+
* The :ref:`user-guide-persist` and :ref:`user-guide-storage` tutorial sections have
20702070
been updated with new examples (:issue:`100`, :issue:`101`, :issue:`103`).
2071-
* A new tutorial section on :ref:`tutorial_pickle` has been added (:issue:`91`).
2072-
* A new tutorial section on :ref:`tutorial_datetime` has been added.
2073-
* A new tutorial section on :ref:`tutorial_diagnostics` has been added.
2074-
* The tutorial sections on :ref:`tutorial_sync` and :ref:`tutorial_tips_blosc` have been
2071+
* A new tutorial section on :ref:`user-guide-pickle` has been added (:issue:`91`).
2072+
* A new tutorial section on :ref:`user-guide-datetime` has been added.
2073+
* A new tutorial section on :ref:`user-guide-diagnostics` has been added.
2074+
* The tutorial sections on :ref:`user-guide-sync` and :ref:`user-guide-tips-blosc` have been
20752075
updated to provide information about how to avoid program hangs when using the Blosc
20762076
compressor with multiple processes (:issue:`199`, :issue:`201`).
20772077

@@ -2177,14 +2177,14 @@ Hierarchies
21772177
~~~~~~~~~~~
21782178

21792179
Support has been added for organizing arrays into hierarchies via groups. See
2180-
the tutorial section on :ref:`tutorial_groups` and the :mod:`zarr.hierarchy`
2180+
the tutorial section on :ref:`user-guide-groups` and the :mod:`zarr.hierarchy`
21812181
API docs for more information.
21822182

21832183
Filters
21842184
~~~~~~~
21852185

21862186
Support has been added for configuring filters to preprocess chunk data prior
2187-
to compression. See the tutorial section on :ref:`tutorial_filters` and the
2187+
to compression. See the tutorial section on :ref:`user-guide-filters` and the
21882188
:mod:`zarr.codecs` API docs for more information.
21892189

21902190
Other changes
@@ -2210,7 +2210,7 @@ Thanks to :user:`Matthew Rocklin <mrocklin>`, :user:`Stephan Hoyer <shoyer>` and
22102210

22112211
* The bundled Blosc library has been upgraded to version 1.10.0. The 'zstd'
22122212
internal compression library is now available within Blosc. See the tutorial
2213-
section on :ref:`tutorial_compress` for an example.
2213+
section on :ref:`user-guide-compress` for an example.
22142214
* When using the Blosc compressor, the default internal compression library
22152215
is now 'lz4'.
22162216
* The default number of internal threads for the Blosc compressor has been
@@ -2236,8 +2236,8 @@ The main motivation for re-organizing the code was to create an
22362236
abstraction layer between the core array logic and data storage (:issue:`21`).
22372237
In this release, any
22382238
object that implements the ``MutableMapping`` interface can be used as
2239-
an array store. See the tutorial sections on :ref:`tutorial_persist`
2240-
and :ref:`tutorial_storage`, the ``spec_v1``, and the
2239+
an array store. See the tutorial sections on :ref:`user-guide-persist`
2240+
and :ref:`user-guide-storage`, the ``spec_v1``, and the
22412241
:mod:`zarr.storage` module documentation for more information.
22422242

22432243
Please note also that the file organization and file name conventions
@@ -2256,8 +2256,8 @@ chunks. This release still bundles the c-blosc library and uses Blosc
22562256
as the default compressor, however other compressors including zlib,
22572257
BZ2 and LZMA are also now supported via the Python standard
22582258
library. New compressors can also be dynamically registered for use
2259-
with Zarr. See the tutorial sections on :ref:`tutorial_compress` and
2260-
:ref:`tutorial_tips_blosc`, the ``spec_v1``, and the
2259+
with Zarr. See the tutorial sections on :ref:`user-guide-compress` and
2260+
:ref:`user-guide-tips-blosc`, the ``spec_v1``, and the
22612261
:mod:`zarr.compressors` module documentation for more information.
22622262

22632263
Synchronization
@@ -2266,7 +2266,7 @@ Synchronization
22662266
The synchronization code has also been refactored to create a layer of
22672267
abstraction, enabling Zarr arrays to be used in parallel computations
22682268
with a number of alternative synchronization methods. For more
2269-
information see the tutorial section on :ref:`tutorial_sync` and the
2269+
information see the tutorial section on :ref:`user-guide-sync` and the
22702270
:mod:`zarr.sync` module documentation.
22712271

22722272
Changes to the Blosc extension
@@ -2288,7 +2288,7 @@ is running within a single-threaded or multi-threaded program and
22882288
adapts its internal behaviour accordingly (:issue:`27`). There is no need for
22892289
the user to make any API calls to switch Blosc between contextual and
22902290
non-contextual (global lock) mode. See also the tutorial section on
2291-
:ref:`tutorial_tips_blosc`.
2291+
:ref:`user-guide-tips-blosc`.
22922292

22932293
Other changes
22942294
~~~~~~~~~~~~~
@@ -2302,7 +2302,7 @@ option present in the previous release, and this has been removed.
23022302
The memory layout within chunks can now be set as either "C"
23032303
(row-major) or "F" (column-major), which can help to provide better
23042304
compression for some data (:issue:`7`). See the tutorial
2305-
section on :ref:`tutorial_chunks_order` for more information.
2305+
section on :ref:`user-guide-chunks-order` for more information.
23062306

23072307
A bug has been fixed within the ``__getitem__`` and ``__setitem__``
23082308
machinery for slicing arrays, to properly handle getting and setting

docs/getting_started.rst

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

0 commit comments

Comments
 (0)