cormorack / yodapy

Your Ocean Data Access in Python
https://cormorack.github.io/yodapy/
MIT License
9 stars 10 forks source link

last line of yodapy example throwing molto grande error #98

Closed robfatland closed 5 years ago

robfatland commented 5 years ago

@lsetiawan yodapy install / test (for OOI conference I'm attending) works great on the Port Cormorack JupyterHub but the very last line (which tries to create an xarray Dataset list) fails on the pangeo NASA JupyterHub... Does the error make clear what might be missing from the latter??

ds_list = ooi.to_xarray()

produces

Traceback (most recent call last):
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/file_manager.py", line 167, in acquire
    file = self._cache[self._key]
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/lru_cache.py", line 42, in __getitem__
    value = self._cache[key]
KeyError: [<function _open_netcdf4_group at 0x7f111253dc80>, ('https://opendap.oceanobservatories.org/thredds/dodsC/ooi/rob5@uw.edu/20190528T140509-RS03AXPS-SF03A-2A-CTDPFA302-streamed-ctdpf_sbe43_sample/deployment0004_RS03AXPS-SF03A-2A-CTDPFA302-streamed-ctdpf_sbe43_sample_20180101T000000.983558-20180101T235959.999175.nc', <SerializableLock: 5b6733ed-2ab3-4c32-880b-60044a7f2831>), 'r', (('clobber', True), ('diskless', False), ('format', 'NETCDF4'), ('group', None), ('persist', False))]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/conda/lib/python3.6/site-packages/gevent/greenlet.py", line 537, in run
    result = self._run(*self.args, **self.kwargs)
  File "/srv/conda/lib/python3.6/site-packages/yodapy/datasources/ooi/helpers.py", line 96, in fetch_xr
    **kwargs)
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/api.py", line 698, in open_mfdataset
    datasets = [open_(p, **open_kwargs) for p in paths]
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/api.py", line 698, in <listcomp>
    datasets = [open_(p, **open_kwargs) for p in paths]
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/api.py", line 363, in open_dataset
    filename_or_obj, group=group, lock=lock, **backend_kwargs)
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/netCDF4_.py", line 352, in open
    return cls(manager, lock=lock, autoclose=autoclose)
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/netCDF4_.py", line 311, in __init__
    self.format = self.ds.data_model
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/netCDF4_.py", line 356, in ds
    return self._manager.acquire().value
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/file_manager.py", line 173, in acquire
    file = self._opener(*self._args, **kwargs)
  File "/srv/conda/lib/python3.6/site-packages/xarray/backends/netCDF4_.py", line 244, in _open_netcdf4_group
    ds = nc4.Dataset(filename, mode=mode, **kwargs)
  File "netCDF4/_netCDF4.pyx", line 2291, in netCDF4._netCDF4.Dataset.__init__
  File "netCDF4/_netCDF4.pyx", line 1855, in netCDF4._netCDF4._ensure_nc_success
OSError: [Errno -45] NetCDF: Not a valid data type or _FillValue type mismatch: b'https://opendap.oceanobservatories.org/thredds/dodsC/ooi/rob5@uw.edu/20190528T140509-RS03AXPS-SF03A-2A-CTDPFA302-streamed-ctdpf_sbe43_sample/deployment0004_RS03AXPS-SF03A-2A-CTDPFA302-streamed-ctdpf_sbe43_sample_20180101T000000.983558-20180101T235959.999175.nc'
Tue May 28 14:06:18 2019 <Greenlet at 0x7f110970f638: fetch_xr(('https://opendap.oceanobservatories.org/thredds/c)> failed with OSError
lsetiawan commented 5 years ago

@robfatland Could you tell me the yodapy versions?

robfatland commented 5 years ago

ummmm.... I did the pip install today... yodapy-0.2.3b0-py3-none-any.whl (113kB)

lsetiawan commented 5 years ago

Between the port cormorack and pangeo? What are the versions?

Do this on a jupyter notebook

import yodapy
print(yodapy.__version__)
robfatland commented 5 years ago

nasa pangeo gives me 0.2.3-beta

port cormorack gives me 0.2.2-beta+67.ga589648

lsetiawan commented 5 years ago

That's why it's not working on the nasa pangeo. I had problems with version 0.2.3-beta, I've fixed it, but haven't had the chance to update the package since I've been focusing on the portal :disappointed: sorry... I'll create a release with the fixes in a bit.

lsetiawan commented 5 years ago

You can always get the latest stuff by installing from github.

pip install git+https://github.com/cormorack/yodapy.git
robfatland commented 5 years ago

Using pip install git+https://github.com/cormorack/yodapy.git works on the NASA pangeo JupyterLab. I'll defer to Don on closing this however.

lsetiawan commented 5 years ago

Problem seemed to be solved. Closing...