Skip to content

Commit

Permalink
Improve installation page (#2538)
Browse files Browse the repository at this point in the history
* Make code blocks console

* Clean up installation page

* Split into pip/conda

* Fix doc headings

* Fix contributing link

* Fix contributing link
  • Loading branch information
dstansby authored Dec 8, 2024
1 parent 333a9e3 commit ed0f199
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 deletions.
38 changes: 24 additions & 14 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
Installation
============

Zarr depends on NumPy. It is generally best to `install NumPy
<https://numpy.org/doc/stable/user/install.html>`_ first using whatever method is most
appropriate for your operating system and Python distribution. Other dependencies should be
installed automatically if using one of the installation methods below.
pip
---

Note: Zarr has endorsed `Scientific-Python SPEC 0 <https://scientific-python.org/specs/spec-0000/>`_ and now follows the version support window as outlined below:
.. code-block:: console
- Python: 36 months after initial release
- Core package dependencies (e.g. NumPy): 24 months after initial release
$ pip install zarr
Install Zarr from PyPI::
There are a number of optional dependency groups you can install for extra functionality.
These can be installed using ``pip install "zarr[<extra>]"``, e.g. ``pip install "zarr[gpu]"``

$ pip install zarr
- ``gpu``: support for GPUs
- ``fsspec``: support for reading/writing to remote data stores
- ``tree``: support for pretty printing of directory trees

Alternatively, install Zarr via conda::
conda
-----

.. code-block:: console
$ conda install -c conda-forge zarr
To install the latest development version of Zarr, you can use pip with the
latest GitHub main::
Conda does not support optional dependencies, so you will have to manually install any packages
needed to enable extra functionality.

Dependency support
------------------
Zarr has endorsed `Scientific-Python SPEC 0 <https://scientific-python.org/specs/spec-0000/>`_ and now follows the version support window as outlined below:

$ pip install git+https://github.com/zarr-developers/zarr-python.git
- Python: 36 months after initial release
- Core package dependencies (e.g. NumPy): 24 months after initial release

To work with Zarr source code in development, see `Contributing <contributing.html>`_.
Development
-----------
To install the latest development version of Zarr, see `the contributing guide <contributing.html>`_.
13 changes: 7 additions & 6 deletions src/zarr/core/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1847,8 +1847,8 @@ def __repr__(self) -> str:
async def update_attributes_async(self, new_attributes: dict[str, Any]) -> Group:
"""Update the attributes of this group.
Example
-------
Examples
--------
>>> import zarr
>>> group = zarr.group()
>>> await group.update_attributes_async({"foo": "bar"})
Expand Down Expand Up @@ -1947,8 +1947,9 @@ def synchronizer(self) -> None:

def update_attributes(self, new_attributes: dict[str, Any]) -> Group:
"""Update the attributes of this group.
Example
-------
Examples
--------
>>> import zarr
>>> group = zarr.group()
>>> group.update_attributes({"foo": "bar"})
Expand Down Expand Up @@ -2027,8 +2028,8 @@ def __contains__(self, member: str) -> bool:
def groups(self) -> Generator[tuple[str, Group], None]:
"""Return the sub-groups of this group as a generator of (name, group) pairs.
Example
-------
Examples
--------
>>> import zarr
>>> group = zarr.group()
>>> group.create_group("subgroup")
Expand Down

0 comments on commit ed0f199

Please sign in to comment.