examples icon indicating copy to clipboard operation
examples copied to clipboard

Land use classification intake-xarray issue

Open ablythed opened this issue 3 years ago • 0 comments

In #167, when running the Image_Classification notebook, the line da = cat.UCMerced_LandUse_all().to_dask() in the third cell produces the following error:

Error
  TypeError                                 Traceback (most recent call last)
  <timed exec> in <module>
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/intake_xarray/base.py in to_dask(self)
       67     def to_dask(self):
       68         """Return xarray object where variables are dask arrays"""
  ---> 69         return self.read_chunked()
       70 
       71     def close(self):
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/intake_xarray/base.py in read_chunked(self)
       42     def read_chunked(self):
       43         """Return xarray object (which will have chunks)"""
  ---> 44         self._load_metadata()
       45         return self._ds
       46 
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/intake/source/base.py in _load_metadata(self)
      234         """load metadata only if needed"""
      235         if self._schema is None:
  --> 236             self._schema = self._get_schema()
      237             self.dtype = self._schema.dtype
      238             self.shape = self._schema.shape
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/intake_xarray/image.py in _get_schema(self)
      352 
      353         if self._ds is None:
  --> 354             self._open_dataset()
      355 
      356             # convert to dataset for serialization
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/intake_xarray/image.py in _open_dataset(self)
      335         from dask.bytes import open_files
      336 
  --> 337         files = open_files(self.urlpath, **self.storage_options)
      338         if len(files) == 0:
      339             raise Exception("No files found at {}".format(self.urlpath))
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/dask/utils.py in wrapper(*args, **kwargs)
       88         def wrapper(*args, **kwargs):
       89             warnings.warn(msg, category=category, stacklevel=2)
  ---> 90             return func(*args, **kwargs)
       91 
       92         return wrapper
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/dask/bytes/__init__.py in open_files(*arg, **kwargs)
       15 @_deprecated(use_instead="fsspec.core.open_files")
       16 def open_files(*arg, **kwargs):
  ---> 17     return fs_open_files(*arg, **kwargs)
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/fsspec/core.py in open_files(urlpath, mode, compression, encoding, errors, name_function, num, protocol, newline, auto_mkdir, expand, **kwargs)
      286         storage_options=kwargs,
      287         protocol=protocol,
  --> 288         expand=expand,
      289     )
      290     if "r" not in mode and auto_mkdir:
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/fsspec/core.py in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
      569     else:
      570         urlpath = stringify_path(urlpath)
  --> 571     chain = _un_chain(urlpath, storage_options or {})
      572     if len(chain) > 1:
      573         inkwargs = {}
  
  ~/development/examples/landuse_classification/envs/default/lib/python3.7/site-packages/fsspec/core.py in _un_chain(path, kwargs)
      326     bits = (
      327         [p if "://" in p or x.match(p) else p + "://" for p in path.split("::")]
  --> 328         if "::" in path
      329         else [path]
      330     )
  
  TypeError: argument of type 'NoneType' is not iterable

I've tried pinning different versions of intake-xarray, but I can't get it to work.

ablythed avatar Aug 17 '21 00:08 ablythed