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

BUG: gnss_tec cannot load for xarray 0.18.0 #46

Closed
jklenzing opened this issue May 10, 2021 · 2 comments · Fixed by #47
Closed

BUG: gnss_tec cannot load for xarray 0.18.0 #46

jklenzing opened this issue May 10, 2021 · 2 comments · Fixed by #47
Labels
bug Something isn't working

Comments

@jklenzing
Copy link
Member

Loading vtec data into xarray is not working with 0.18.0. Test code (assuming data has been downloaded):

import datetime as dt
import pysat
import pysatMadrigal

test_date = dt.datetime(2017, 11, 19)
gns = pysat.Instrument(inst_module=pysatMadrigal.instruments.gnss_tec, tag='vtec')
gns.load(date=test_date)

Error message:

~/code/core/pysatMadrigal/pysatMadrigal/instruments/methods/general.py in load(fnames, tag, inst_id, xarray_coords, file_type)
     92         # Xarray natively opens netCDF data into a Dataset
     93         if len(fnames) == 1:
---> 94             file_data = xr.open_dataset(fnames[0])
     95         else:
     96             file_data = xr.open_mfdataset(fnames, combine='by_coords')

/opt/anaconda3/lib/python3.8/site-packages/xarray/backends/api.py in open_dataset(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, backend_kwargs, *args, **kwargs)
    483 
    484     if engine is None:
--> 485         engine = plugins.guess_engine(filename_or_obj)
    486 
    487     backend = plugins.get_backend(engine)

/opt/anaconda3/lib/python3.8/site-packages/xarray/backends/plugins.py in guess_engine(store_spec)
    110             warnings.warn(f"{engine!r} fails while guessing", RuntimeWarning)
    111 
--> 112     raise ValueError("cannot guess the engine, try passing one explicitly")
    113 
    114 

ValueError: cannot guess the engine, try passing one explicitly

Discovered during work on #45. Previous CI tests using conda are still using xarray 0.17.0.

@jklenzing jklenzing added the bug Something isn't working label May 10, 2021
@jklenzing
Copy link
Member Author

This seems to just affect gnss_tec, which uses the netcdf4. JRO still uses hdf5, which passes through correctly.

@aburrell
Copy link
Member

Requires engine="netcdf4" for NetCDF4 files calling xr.open_dataset

@aburrell aburrell mentioned this issue May 10, 2021
@aburrell aburrell linked a pull request May 10, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants