Skip to content

Commit 24a72fe

Browse files
committed
docs: major refactor in preparation for the 3.0 release
1 parent a7714c7 commit 24a72fe

23 files changed

+1527
-1866
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ coverage.xml
5252
# Sphinx documentation
5353
docs/_build/
5454
docs/_autoapi
55+
docs/data
5556

5657
# PyBuilder
5758
target/

data/donotdelete

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
"sphinx_copybutton",
4949
"sphinx_design",
5050
'sphinx_reredirects',
51+
"IPython.sphinxext.ipython_directive",
52+
"IPython.sphinxext.ipython_console_highlighting",
5153
]
5254

5355
issues_github_path = "zarr-developers/zarr-python"
@@ -87,6 +89,11 @@
8789
"spec/v1": 'https://zarr-specs.readthedocs.io/en/latest/v1/v1.0.html',
8890
"spec/v2": "https://zarr-specs.readthedocs.io/en/latest/v2/v2.0.html",
8991
"spec/v3": "https://zarr-specs.readthedocs.io/en/latest/v3/core/v3.0.html",
92+
"tutorial": "user-guide",
93+
"contributing": "developers/contributing.html",
94+
"release": "developers/release.html",
95+
"roadmap": "developers/roadmap.html",
96+
"installation": "user-guide/installation.html",
9097
}
9198

9299
# The language for content autogenerated by Sphinx. Refer to documentation

docs/contributing.rst renamed to docs/developers/contributing.rst

Lines changed: 17 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ a bug report:
3333
# etc.
3434
```
3535

36-
2. An explanation of why the current behaviour is wrong/not desired, and what you
36+
2. An explanation of why the current behavior is wrong/not desired, and what you
3737
expect instead.
3838

3939
3. Information about the version of Zarr, along with versions of dependencies and the
@@ -46,8 +46,7 @@ a bug report:
4646
interpreter can be obtained by running a Python interactive session, e.g.::
4747

4848
$ python
49-
Python 3.6.1 (default, Mar 22 2017, 06:17:05)
50-
[GCC 6.3.0 20170321] on linux
49+
Python 3.12.7 | packaged by conda-forge | (main, Oct 4 2024, 15:57:01) [Clang 17.0.6 ] on darwin
5150

5251
Enhancement proposals
5352
---------------------
@@ -82,21 +81,21 @@ the "Fork" button. Then clone your fork to your local machine::
8281
Creating a development environment
8382
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8483

85-
To work with the Zarr source code, it is recommended to set up a Python virtual
86-
environment and install all Zarr dependencies using the same versions as are used by
84+
To work with the Zarr source code, it is recommended to use `hatch
85+
<https://hatch.pypa.io/latest/index.html>`_ to create a virtual environment and
86+
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
8888
3 interpreter already installed, and you have cloned the Zarr source code and your
8989
current working directory is the root of the repository, you can do something like
9090
the following::
9191

92-
$ mkdir -p ~/pyenv/zarr-dev
93-
$ python -m venv ~/pyenv/zarr-dev
94-
$ source ~/pyenv/zarr-dev/bin/activate
95-
$ pip install -e .[test,docs]
92+
$ pip install hatch
93+
$ hatch env show # list all available environments
9694

97-
To verify that your development environment is working, you can run the unit tests::
95+
To verify that your development environment is working, you can run the unit tests
96+
for one of the test environments, e.g.::
9897

99-
$ python -m pytest -v tests
98+
$ hatch env run --env test.py3.12-2.1-optional run
10099

101100
Creating a branch
102101
~~~~~~~~~~~~~~~~~
@@ -143,40 +142,11 @@ spec. The simplest way to run the unit tests is to activate your
143142
development environment (see `creating a development environment`_ above)
144143
and invoke::
145144

146-
$ python -m pytest -v zarr
147-
148-
Some tests require optional dependencies to be installed, otherwise
149-
the tests will be skipped. To install all optional dependencies, run::
150-
151-
$ pip install pytest-doctestplus
152-
153-
To also run the doctests within docstrings (requires optional
154-
dependencies to be installed), run::
155-
156-
$ python -m pytest -v --doctest-plus zarr
157-
158-
To run the doctests within the tutorial and storage spec (requires
159-
optional dependencies to be installed), run::
160-
161-
$ python -m doctest -o NORMALIZE_WHITESPACE -o ELLIPSIS docs/tutorial.rst docs/spec/v2.rst
162-
163-
Note that some tests also require storage services to be running
164-
locally. To run the Azure Blob Service storage tests, run an Azure
165-
storage emulator (e.g., azurite) and set the environment variable
166-
``ZARR_TEST_ABS=1``. If you're using Docker to run azurite, start the service with::
167-
168-
docker run --rm -p 10000:10000 mcr.microsoft.com/azure-storage/azurite azurite-blob --loose --blobHost 0.0.0.0
169-
170-
To run the Mongo DB storage tests, run a Mongo
171-
server locally and set the environment variable ``ZARR_TEST_MONGO=1``.
172-
To run the Redis storage tests, run a Redis server locally on port
173-
6379 and set the environment variable ``ZARR_TEST_REDIS=1``.
145+
$ hatch env run --env test.py3.12-2.1-optional run
174146

175147
All tests are automatically run via GitHub Actions for every pull
176148
request and must pass before code can be accepted. Test coverage is
177-
also collected automatically via the Codecov service, and total
178-
coverage over all builds must be 100% (although individual builds
179-
may be lower due to Python 2/3 or other differences).
149+
also collected automatically via the Codecov service.
180150

181151
Code standards - using pre-commit
182152
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -209,11 +179,11 @@ the ``--no-verify`` option with ``git commit``.
209179
Test coverage
210180
~~~~~~~~~~~~~
211181

212-
Zarr maintains 100% test coverage under the latest Python stable release (currently
213-
Python 3.8). Both unit tests and docstring doctests are included when computing
182+
Zarr strives to maintain 100% test coverage under the latest Python stable release
183+
(currently Python 3.12). Both unit tests and docstring doctests are included when computing
214184
coverage. Running::
215185

216-
$ python -m pytest -v --cov=zarr --cov-config=pyproject.toml zarr
186+
$ hatch env run --env test.py3.12-2.1-optional run-coverage
217187

218188
will automatically run the test suite with coverage and produce a coverage report.
219189
This should be 100% before code can be accepted into the main code base.
@@ -229,11 +199,7 @@ Docstrings for user-facing classes and functions should follow the
229199
`numpydoc
230200
<https://numpydoc.readthedocs.io/en/stable/format.html#docstring-standard>`_
231201
standard, including sections for Parameters and Examples. All examples
232-
should run and pass as doctests under Python 3.8. To run doctests,
233-
activate your development environment, install optional requirements,
234-
and run::
235-
236-
$ python -m pytest -v --doctest-plus tests
202+
should run and pass as doctests under Python 3.10.
237203

238204
Zarr uses Sphinx for documentation, hosted on readthedocs.org. Documentation is
239205
written in the RestructuredText markup language (.rst files) in the ``docs`` folder.
@@ -245,9 +211,7 @@ notes (``docs/release.rst``).
245211

246212
The documentation can be built locally by running::
247213

248-
$ cd docs
249-
$ make clean; make html
250-
$ open _build/html/index.html
214+
$ hatch --env docs run build
251215

252216
The resulting built documentation will be available in the ``docs/_build/html`` folder.
253217

docs/developers/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
.. toctree::
3+
:maxdepth: 1
4+
:hidden:
5+
6+
release
7+
contributing
8+
roadmap
File renamed without changes.
File renamed without changes.

docs/getting_started.rst

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

docs/guide/index.rst

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

docs/index.rst

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,72 @@ Zarr-Python
88
:maxdepth: 1
99
:hidden:
1010

11-
getting_started
12-
tutorial
13-
guide/index
11+
quickstart
12+
user-guide/index
1413
api/index
15-
release
16-
license
17-
contributing
18-
roadmap
14+
developers/contributing
15+
developers/release
1916

2017
**Version**: |version|
2118

2219
**Download documentation**: `PDF/Zipped HTML <https://readthedocs.org/projects/zarr/downloads/>`_
2320

2421
**Useful links**:
25-
`Installation <installation.html>`_ |
2622
`Source Repository <https://github.com/zarr-developers/zarr-python>`_ |
2723
`Issue Tracker <https://github.com/zarr-developers/zarr-python/issues>`_ |
2824
`Zulip Chat <https://ossci.zulipchat.com/>`_ |
2925
`Zarr specifications <https://zarr-specs.readthedocs.io>`_
3026

31-
Zarr is a file storage format for chunked, compressed, N-dimensional arrays based on an open-source specification.
27+
Zarr is a file storage format for chunked, compressed, N-dimensional arrays based on an open-source specification. Highlights include:
28+
29+
* Create N-dimensional arrays with any NumPy dtype.
30+
* Chunk arrays along any dimension.
31+
* Compress and/or filter chunks using any Numcodecs_ codec.
32+
* Store arrays in memory, on disk, inside a Zip file, on S3, ...
33+
* Read an array concurrently from multiple threads or processes.
34+
* Write to an array concurrently from multiple threads or processes.
35+
* Organize arrays into hierarchies via groups.
36+
37+
Zarr-Python Documentation
38+
-------------------------
3239

3340
.. grid:: 2
3441

3542
.. grid-item-card::
3643
:img-top: _static/index_getting_started.svg
3744

38-
Getting Started
39-
^^^^^^^^^^^^^^^
45+
Quick Start
46+
^^^^^^^^^^^
4047

41-
New to Zarr? Check out the getting started guide. It contains an
48+
New to Zarr? Check out the quick start guide. It contains an
4249
introduction to Zarr's main concepts and links to additional tutorials.
4350

4451
+++
4552

46-
.. button-ref:: getting_started
53+
.. button-ref:: quickstart
4754
:expand:
4855
:color: dark
4956
:click-parent:
5057

51-
To the getting started guide
58+
To the Quick Start
5259

5360
.. grid-item-card::
5461
:img-top: _static/index_user_guide.svg
5562

56-
Tutorial
57-
^^^^^^^^
63+
Guide
64+
^^^^^
5865

59-
The tutorial provides working examples of Zarr classes and functions.
66+
The user guide provides a detailed guide for how to use Zarr-Python.
6067

6168
+++
6269

63-
.. button-ref:: tutorial
70+
.. button-ref:: user-guide
6471
:ref-type: ref
6572
:expand:
6673
:color: dark
6774
:click-parent:
6875

69-
To the Tutorial
76+
To the User Guide
7077

7178
.. grid-item-card::
7279
:img-top: _static/index_api.svg
@@ -98,9 +105,11 @@ Zarr is a file storage format for chunked, compressed, N-dimensional arrays base
98105

99106
+++
100107

101-
.. button-ref:: contributing
108+
.. button-ref:: developers/contributing
102109
:expand:
103110
:color: dark
104111
:click-parent:
105112

106113
To the contributor's guide
114+
115+
.. _Numcodecs: https://numcodecs.readthedocs.io

0 commit comments

Comments
 (0)