Skip to content

Commit 3f66393

Browse files
authored
Merge pull request #172 from alimanfoo/advanced-indexing-20171028
Advanced indexing
2 parents 5f254f0 + d08189c commit 3f66393

22 files changed

+6693
-623
lines changed

docs/api/codecs.rst

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,22 @@ Compressors and filters (``zarr.codecs``)
22
=========================================
33
.. module:: zarr.codecs
44

5-
This module contains compressor and filter classes for use with Zarr.
5+
This module contains compressor and filter classes for use with Zarr. Please note that this module
6+
is provided for backwards compatibility with previous versions of Zarr. From Zarr version 2.2
7+
onwards, all codec classes have been moved to a separate package called Numcodecs_. The two
8+
packages (Zarr and Numcodecs_) are designed to be used together. For example, a Numcodecs_ codec
9+
class can be used as a compressor for a Zarr array::
610

7-
Other codecs can be registered dynamically with Zarr. All that is required
8-
is to implement a class that provides the same interface as the classes listed
9-
below, and then to add the class to the ``codec_registry``. See the source
10-
code of this module for details.
11+
>>> import zarr
12+
>>> from numcodecs import Blosc
13+
>>> z = zarr.zeros(1000000, compressor=Blosc(cname='zstd', clevel=1, shuffle=Blosc.SHUFFLE)
1114

12-
.. autoclass:: Codec
15+
Codec classes can also be used as filters. See the tutorial section on :ref:`tutorial_filters`
16+
for more information.
1317

14-
.. automethod:: encode
15-
.. automethod:: decode
16-
.. automethod:: get_config
17-
.. automethod:: from_config
18+
Please note that it is also relatively straightforward to define and register custom codec
19+
classes. See the Numcodecs `codec API <http://numcodecs.readthedocs.io/en/latest/abc.html>`_ and
20+
`codec registry <http://numcodecs.readthedocs.io/en/latest/registry.html>`_ documentation for more
21+
information.
1822

19-
.. autoclass:: Blosc
20-
.. autoclass:: Zlib
21-
.. autoclass:: BZ2
22-
.. autoclass:: LZMA
23-
.. autoclass:: Delta
24-
.. autoclass:: AsType
25-
.. autoclass:: FixedScaleOffset
26-
.. autoclass:: Quantize
27-
.. autoclass:: PackBits
28-
.. autoclass:: Categorize
23+
.. _Numcodecs: http://numcodecs.readthedocs.io/

docs/api/core.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The Array class (``zarr.core``)
66

77
.. automethod:: __getitem__
88
.. 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_coordinate_selection
14+
.. automethod:: set_coordinate_selection
15+
.. automethod:: get_orthogonal_selection
16+
.. automethod:: set_orthogonal_selection
917
.. automethod:: resize
1018
.. automethod:: append
1119
.. automethod:: view

docs/index.rst

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,25 @@ Highlights
1212

1313
* Create N-dimensional arrays with any NumPy dtype.
1414
* Chunk arrays along any dimension.
15-
* Compress chunks using the fast Blosc_ meta-compressor or alternatively using zlib, BZ2 or LZMA.
15+
* Compress and/or filter chunks using any numcodecs_ codec.
1616
* Store arrays in memory, on disk, inside a Zip file, on S3, ...
1717
* Read an array concurrently from multiple threads or processes.
1818
* Write to an array concurrently from multiple threads or processes.
1919
* Organize arrays into hierarchies via groups.
20-
* Use filters to preprocess data and improve compression.
2120

2221
Status
2322
------
2423

25-
Zarr is still in an early phase of development. Feedback and bug
26-
reports are very welcome, please get in touch via the `GitHub issue
27-
tracker <https://github.com/alimanfoo/zarr/issues>`_.
24+
Zarr is still a young project. Feedback and bug reports are very welcome, please get in touch via
25+
the `GitHub issue tracker <https://github.com/alimanfoo/zarr/issues>`_.
2826

2927
Installation
3028
------------
3129

3230
Zarr depends on NumPy. It is generally best to `install NumPy
33-
<http://docs.scipy.org/doc/numpy/user/install.html>`_ first using
34-
whatever method is most appropriate for you operating system and
35-
Python distribution.
31+
<http://docs.scipy.org/doc/numpy/user/install.html>`_ first using whatever method is most
32+
appropriate for you operating system and Python distribution. Other dependencies should be
33+
installed automatically if using one of the installation methods below.
3634

3735
Install Zarr from PyPI::
3836

@@ -41,26 +39,18 @@ Install Zarr from PyPI::
4139
Alternatively, install Zarr via conda::
4240

4341
$ conda install -c conda-forge zarr
44-
45-
Zarr includes a C extension providing integration with the Blosc_
46-
library. Installing via conda will install a pre-compiled binary distribution.
47-
However, if you have a newer CPU that supports the AVX2 instruction set (e.g.,
48-
Intel Haswell, Broadwell or Skylake) then installing via pip is preferable,
49-
because this will compile the Blosc library from source with optimisations
50-
for AVX2.
51-
42+
5243
To work with Zarr source code in development, install from GitHub::
5344

5445
$ git clone --recursive https://github.com/alimanfoo/zarr.git
5546
$ cd zarr
5647
$ python setup.py install
5748

58-
To verify that Zarr has been fully installed (including the Blosc
59-
extension) run the test suite::
49+
To verify that Zarr has been fully installed, run the test suite::
6050

6151
$ pip install nose
6252
$ python -m nose -v zarr
63-
53+
6454
Contents
6555
--------
6656

@@ -75,13 +65,20 @@ Contents
7565
Acknowledgments
7666
---------------
7767

78-
Zarr bundles the `c-blosc <https://github.com/Blosc/c-blosc>`_
79-
library and uses it as the default compressor.
68+
The following people have contributed to the development of Zarr, by contributing code and/or
69+
providing ideas, feedback and advice:
70+
71+
* `Francesc Alted <https://github.com/FrancescAlted>`_
72+
* `Stephan Hoyer <https://github.com/shoyer>`_
73+
* `John Kirkham <https://github.com/jakirkham>`_
74+
* `Alistair Miles <https://github.com/alimanfoo>`_
75+
* `Matthew Rocklin <https://github.com/mrocklin>`_
76+
* `Vincent Schut <https://github.com/vincentschut>`_
8077

8178
Zarr is inspired by `HDF5 <https://www.hdfgroup.org/HDF5/>`_, `h5py
8279
<http://www.h5py.org/>`_ and `bcolz <http://bcolz.blosc.org/>`_.
8380

84-
Development of this package is supported by the
81+
Development of Zarr is supported by the
8582
`MRC Centre for Genomics and Global Health <http://www.cggh.org>`_.
8683

8784
Indices and tables
@@ -91,4 +88,4 @@ Indices and tables
9188
* :ref:`modindex`
9289
* :ref:`search`
9390

94-
.. _Blosc: http://www.blosc.org/
91+
.. _numcodecs: http://numcodecs.readthedocs.io/

0 commit comments

Comments
 (0)