Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Zarr backend #1528

Merged
merged 85 commits into from
Dec 14, 2017
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
5cdf6c8
added HiddenKeyDict class
rabernat Aug 27, 2017
f305c25
new zarr backend
rabernat Aug 27, 2017
2ea21c5
added HiddenKeyDict class
rabernat Aug 27, 2017
d92bf2f
new zarr backend
rabernat Aug 27, 2017
79da971
add zarr to ci reqs
Oct 5, 2017
31e4409
add zarr api to docs
Oct 5, 2017
2ec5ee5
some zarr tests passing
rabernat Oct 6, 2017
bd21720
Merge pull request #1 from jhamman/zarr_backend
rabernat Oct 6, 2017
7e898fc
merged stuff from joe
rabernat Oct 6, 2017
af5ff6c
Merge branch 'master' of github.com:pydata/xarray into zarr_backend
Oct 6, 2017
9e7cc09
Merge branch 'zarr_backend' of github.com:rabernat/xray into zarr_bac…
Oct 6, 2017
3f01365
requires zarr decorator
Oct 6, 2017
41cf706
Merge pull request #2 from jhamman/zarr_backend
rabernat Oct 6, 2017
fd9fd0f
wip
rabernat Oct 7, 2017
9f16e8f
added chunking test
rabernat Oct 8, 2017
fe9ebe7
remove debuggin statements
rabernat Oct 8, 2017
c01cd09
fixed HiddenKeyDict
rabernat Oct 8, 2017
b3e5d76
added HiddenKeyDict class
rabernat Aug 27, 2017
45375b2
new zarr backend
rabernat Aug 27, 2017
0e79718
add zarr to ci reqs
Oct 5, 2017
3d39ade
add zarr api to docs
Oct 5, 2017
3d09c67
some zarr tests passing
rabernat Oct 6, 2017
0b4a27a
requires zarr decorator
Oct 6, 2017
f39035c
wip
rabernat Oct 7, 2017
6446ea2
added chunking test
rabernat Oct 8, 2017
9136064
remove debuggin statements
rabernat Oct 8, 2017
2966100
fixed HiddenKeyDict
rabernat Oct 8, 2017
6bedf22
wip
rabernat Oct 14, 2017
ced8267
finished merge
rabernat Oct 16, 2017
e461cdb
finished merge
rabernat Oct 16, 2017
049bf9e
create opener object
rabernat Oct 16, 2017
c169128
trying to get caching working
rabernat Oct 16, 2017
82ef456
caching still not working
rabernat Oct 16, 2017
3ee243e
merge conflicts
rabernat Nov 13, 2017
e20c29f
updating zarr backend with new indexing mixins
rabernat Nov 13, 2017
f82c8c1
added new zarr dev test env
rabernat Nov 13, 2017
43e539f
update travis
rabernat Nov 13, 2017
66299f0
move zarr-dev to travis allowed failures
rabernat Nov 13, 2017
2fce362
fix typo in env file
rabernat Nov 13, 2017
c19b81a
wip
rabernat Nov 17, 2017
68b8f07
fixed zarr auto_chunk
rabernat Nov 17, 2017
0ea0dad
refactored zarr tests
rabernat Nov 17, 2017
58b3bf0
new encoding test
rabernat Nov 17, 2017
9da22da
Merge branch 'master' of github.com:pydata/xarray into zarr_backend_jjh
Nov 17, 2017
a8b4785
cleanup and buildout ZarrArrayWrapper, vectorized indexing
Nov 17, 2017
2a6a776
Merge pull request #4 from jhamman/zarr_backend_jjh
rabernat Nov 17, 2017
021d3ba
more wip
rabernat Nov 27, 2017
5ef10d2
removed chaching test
rabernat Nov 17, 2017
e47d936
Merge remote-tracking branch 'origin/zarr_backend' into zarr_backend
rabernat Nov 27, 2017
a4b024e
very close to passing all tests
rabernat Nov 27, 2017
d8842a6
Merge remote-tracking branch 'upstream/master' into zarr_backend
rabernat Nov 28, 2017
54d116d
modified inheritance
rabernat Nov 29, 2017
94678f4
subclass AbstractWriteableDataStore
rabernat Nov 29, 2017
64942e5
Merge remote-tracking branch 'origin/zarr_backend' into zarr_backend
rabernat Dec 1, 2017
f584456
xfailed certain tests
rabernat Dec 1, 2017
c43284e
pr comments wip
rabernat Dec 4, 2017
9df6e50
removed autoclose
rabernat Dec 4, 2017
012e858
new test for chunk encoding
rabernat Dec 4, 2017
b1819f4
added another test
rabernat Dec 5, 2017
8eb98c9
tests for HiddenKeyDict
rabernat Dec 6, 2017
64bd76c
flake8
rabernat Dec 6, 2017
cffa158
Merge remote-tracking branch 'upstream/master' into zarr_backend
rabernat Dec 6, 2017
3b4a941
zarr version update
rabernat Dec 6, 2017
688f415
added more tests
rabernat Dec 6, 2017
c115a2b
added compressor test
rabernat Dec 6, 2017
4c92531
docs
rabernat Dec 6, 2017
61027eb
weird ascii character issue
rabernat Dec 6, 2017
bbaa776
doc fixes
rabernat Dec 6, 2017
c8f23a5
what's new
rabernat Dec 6, 2017
f0c76f7
more file encoding nightmares
rabernat Dec 6, 2017
a84e388
Tests for backends.zarr._replace_slices_with_arrays
shoyer Dec 6, 2017
37bc2f0
respond to @shoyer's review
rabernat Dec 6, 2017
8cd1707
final fixes
rabernat Dec 7, 2017
ac27411
put back @shoyer's original max function
rabernat Dec 7, 2017
618bf81
another try with 2.7-safe max function
rabernat Dec 7, 2017
e942130
put back @shoyer's original max function
rabernat Dec 7, 2017
b1fa690
bypass lock on ArrayWriter
rabernat Dec 8, 2017
4089d13
Merge branch 'zarr_backend' of github.com:rabernat/xarray into zarr_b…
rabernat Dec 8, 2017
ba200c1
eliminate read mode
rabernat Dec 8, 2017
8dafaf7
added zarr distributed integration test
rabernat Dec 8, 2017
85174cd
fixed max bug
rabernat Dec 8, 2017
c76a01b
change lock to False
rabernat Dec 11, 2017
c011c2d
fix doc typos
rabernat Dec 11, 2017
054ffeb
Merge branch 'master' into zarr_backend
rabernat Dec 12, 2017
f5633ca
Merge branch 'master' into zarr_backend
rabernat Dec 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ matrix:
env: CONDA_ENV=py36-pynio-dev
- python: 3.6
env: CONDA_ENV=py36-rasterio1.0alpha
- python: 3.6
env: CONDA_ENV=py36-zarr-dev
allow_failures:
- python: 3.6
env:
Expand All @@ -67,6 +69,8 @@ matrix:
env: CONDA_ENV=py36-pynio-dev
- python: 3.6
env: CONDA_ENV=py36-rasterio1.0alpha
- python: 3.6
env: CONDA_ENV=py36-zarr-dev

before_install:
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
Expand Down
1 change: 1 addition & 0 deletions ci/requirements-py27-cdat+pynio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies:
- seaborn
- toolz
- rasterio
- zarr
- pip:
- coveralls
- pytest-cov
1 change: 1 addition & 0 deletions ci/requirements-py27-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ dependencies:
- seaborn
- toolz
- rasterio
- zarr
1 change: 1 addition & 0 deletions ci/requirements-py35.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies:
- seaborn
- toolz
- rasterio
- zarr
- pip:
- coveralls
- pytest-cov
1 change: 1 addition & 0 deletions ci/requirements-py36-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ dependencies:
- seaborn
- toolz
- rasterio
- zarr
20 changes: 20 additions & 0 deletions ci/requirements-py36-zarr-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: test_env
channels:
- conda-forge
dependencies:
- python=3.6
- dask
- distributed
- matplotlib
- pytest
- flake8
- numpy
- pandas
- scipy
- seaborn
- toolz
- bottleneck
- pip:
- coveralls
- pytest-cov
- git+https://github.com/alimanfoo/zarr.git
1 change: 1 addition & 0 deletions ci/requirements-py36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies:
- toolz
- rasterio
- bottleneck
- zarr
- pip:
- coveralls
- pytest-cov
Expand Down
2 changes: 2 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ Dataset methods
open_dataset
open_mfdataset
open_rasterio
open_zarr
Dataset.to_netcdf
Dataset.to_zarr
save_mfdataset
Dataset.to_array
Dataset.to_dataframe
Expand Down
1 change: 1 addition & 0 deletions doc/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ For netCDF and IO
reading and writing netCDF4 files that does not use the netCDF-C libraries
- `pynio <https://www.pyngl.ucar.edu/Nio.shtml>`__: for reading GRIB and other
geoscience specific file formats
- `zarr <http://zarr.readthedocs.io/`__: for chunked, compressed, N-dimensional arrays.

For accelerating xarray
~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
12 changes: 12 additions & 0 deletions doc/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,17 @@ longitudes and latitudes.
.. _test files: https://github.com/mapbox/rasterio/blob/master/tests/data/RGB.byte.tif
.. _pyproj: https://github.com/jswhit/pyproj

Zarr
----

`Zarr`_ is a Python package providing an implementation of chunked, compressed,
N-dimensional arrays.

TODO: fill in these docs

.. _Zarr: http://zarr.readthedocs.io/


.. _io.pynio:

Formats supported by PyNIO
Expand Down Expand Up @@ -529,6 +540,7 @@ exporting your objects to pandas and using its broad range of `IO tools`_.
.. _IO tools: http://pandas.pydata.org/pandas-docs/stable/io.html



Combining multiple files
------------------------

Expand Down
1 change: 1 addition & 0 deletions xarray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from .backends.api import (open_dataset, open_dataarray, open_mfdataset,
save_mfdataset)
from .backends.rasterio_ import open_rasterio
from .backends.zarr import open_zarr

from .conventions import decode_cf, SerializationWarning

Expand Down
1 change: 1 addition & 0 deletions xarray/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
from .pynio_ import NioDataStore
from .scipy_ import ScipyDataStore
from .h5netcdf_ import H5NetCDFStore
from .zarr import ZarrStore
26 changes: 26 additions & 0 deletions xarray/backends/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,3 +713,29 @@ def save_mfdataset(datasets, paths, mode='w', format=None, groups=None,
finally:
for store in stores:
store.close()


def to_zarr(dataset, store=None, mode='a', synchronizer=None, group=None,
encoding=None):
"""This function creates an appropriate datastore for writing a dataset to
disk a zarr ztore

See `Dataset.to_zarr` for full API docs.
"""
if isinstance(store, path_type):
store = str(store)
if encoding is None:
encoding = {}

# validate Dataset keys, DataArray names, and attr keys/values
_validate_dataset_names(dataset)
_validate_attrs(dataset)

store = backends.ZarrStore(store=store, mode=mode,
synchronizer=synchronizer, group=group,
writer=None)

# I think zarr stores should always be sync'd immediately
# TODO: figure out how to properly handle unlimited_dims
dataset.dump_to_store(store, sync=True, encoding=encoding)
return store
Loading