Skip to content

zarr RTD docs broken #1898

Closed
Closed
@rabernat

Description

@rabernat

This is what is getting rendered on RTD
http://xarray.pydata.org/en/latest/io.html#zarr

In [26]: ds = xr.Dataset({'foo': (('x', 'y'), np.random.rand(4, 5))},
   ....:                 coords={'x': [10, 20, 30, 40],
   ....:                         'y': pd.date_range('2000-01-01', periods=5),
   ....:                         'z': ('x', list('abcd'))})
   ....: 

In [27]: ds.to_zarr('path/to/directory.zarr')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-27-8c5f1b00edbc> in <module>()
----> 1 ds.to_zarr('path/to/directory.zarr')

/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/latest/lib/python3.5/site-packages/xarray-0.10.0+dev55.g1d32399-py3.5.egg/xarray/core/dataset.py in to_zarr(self, store, mode, synchronizer, group, encoding)
   1165         from ..backends.api import to_zarr
   1166         return to_zarr(self, store=store, mode=mode, synchronizer=synchronizer,
-> 1167                        group=group, encoding=encoding)
   1168 
   1169     def __unicode__(self):

/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/latest/lib/python3.5/site-packages/xarray-0.10.0+dev55.g1d32399-py3.5.egg/xarray/backends/api.py in to_zarr(dataset, store, mode, synchronizer, group, encoding)
    752     # I think zarr stores should always be sync'd immediately
    753     # TODO: figure out how to properly handle unlimited_dims
--> 754     dataset.dump_to_store(store, sync=True, encoding=encoding)
    755     return store

/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/latest/lib/python3.5/site-packages/xarray-0.10.0+dev55.g1d32399-py3.5.egg/xarray/core/dataset.py in dump_to_store(self, store, encoder, sync, encoding, unlimited_dims)
   1068 
   1069         store.store(variables, attrs, check_encoding,
-> 1070                     unlimited_dims=unlimited_dims)
   1071         if sync:
   1072             store.sync()

/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/latest/lib/python3.5/site-packages/xarray-0.10.0+dev55.g1d32399-py3.5.egg/xarray/backends/zarr.py in store(self, variables, attributes, *args, **kwargs)
    378     def store(self, variables, attributes, *args, **kwargs):
    379         AbstractWritableDataStore.store(self, variables, attributes,
--> 380                                         *args, **kwargs)
    381 
    382 

/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/latest/lib/python3.5/site-packages/xarray-0.10.0+dev55.g1d32399-py3.5.egg/xarray/backends/common.py in store(self, variables, attributes, check_encoding_set, unlimited_dims)
    275         variables, attributes = self.encode(variables, attributes)
    276 
--> 277         self.set_attributes(attributes)
    278         self.set_dimensions(variables, unlimited_dims=unlimited_dims)
    279         self.set_variables(variables, check_encoding_set,

/home/docs/checkouts/readthedocs.org/user_builds/xray/conda/latest/lib/python3.5/site-packages/xarray-0.10.0+dev55.g1d32399-py3.5.egg/xarray/backends/zarr.py in set_attributes(self, attributes)
    341 
    342     def set_attributes(self, attributes):
--> 343         self.ds.attrs.put(attributes)
    344 
    345     def encode_variable(self, variable):

AttributeError: 'Attributes' object has no attribute 'put'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions