Skip to content

Challenges running xarray wrapped netcdf files #629

Description

@pwolfram

This is a traceback from calling compute on an XArray computation on dask.distributed.

We're able to use dask.array on a NetCDF4 object without locks if our workers have single threads. However, when computing on the .data attribute backed by a NetCDF object wrapped by a few XArray containers we run into the following error. It appears to be coming from computing the shape, which is odd. Traceback below:

cc @mrocklin@shoyer

In [168]: ds=xr.open_mfdataset(fname, lock=False)
In [169]: ds.yParticle.data.sum().compute()
/net/scratch3/pwolfram/miniconda2/lib/python2.7/site-packages/dask/array/core.pycingetarray()
47lock.acquire()
48try:
--->49c=a[b]
50iftype(c) !=np.ndarray:
51c=np.asarray(c)
/users/pwolfram/lib/python2.7/site-packages/xarray/core/indexing.pycin__getitem__()
396397def__getitem__(self, key):
-->398returntype(self)(self.array, self._updated_key(key))
399400def__setitem__(self, key, value):
/users/pwolfram/lib/python2.7/site-packages/xarray/core/indexing.pycin_updated_key()
372373def_updated_key(self, new_key):
-->374new_key=iter(canonicalize_indexer(new_key, self.ndim))
375key= []
376forsize, kinzip(self.array.shape, self.key):
/users/pwolfram/lib/python2.7/site-packages/xarray/core/utils.pycinndim()
380 @property381defndim(self):
-->382returnlen(self.shape)
383384 @property/users/pwolfram/lib/python2.7/site-packages/xarray/core/indexing.pycinshape()
384defshape(self):
385shape= []
-->386forsize, kinzip(self.array.shape, self.key):
387ifisinstance(k, slice):
388shape.append(len(range(*k.indices(size))))
/users/pwolfram/lib/python2.7/site-packages/xarray/conventions.pycinshape()
447 @property448defshape(self):
-->449returnself.array.shape[:-1]
450451def__str__(self):
/users/pwolfram/lib/python2.7/site-packages/xarray/core/indexing.pycinshape()
384defshape(self):
385shape= []
-->386forsize, kinzip(self.array.shape, self.key):
387ifisinstance(k, slice):
388shape.append(len(range(*k.indices(size))))
/users/pwolfram/lib/python2.7/site-packages/xarray/core/utils.pycinshape()
407 @property408defshape(self):
-->409returnself.array.shape410411def__array__(self, dtype=None):
netCDF4/_netCDF4.pyxinnetCDF4._netCDF4.Variable.shape.__get__ (netCDF4/_netCDF4.c:32778)()
netCDF4/_netCDF4.pyxinnetCDF4._netCDF4.Variable._getdims (netCDF4/_netCDF4.c:31870)()
RuntimeError: NetCDF: NotavalidID

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions