diff --git a/ci/environment-upstream-dev.yml b/ci/environment-upstream-dev.yml index 5c3c754..4726044 100644 --- a/ci/environment-upstream-dev.yml +++ b/ci/environment-upstream-dev.yml @@ -13,6 +13,8 @@ dependencies: - pytest-xdist - tqdm - xarray + - pydap + - aiohttp - pip: - git+https://github.com/intake/intake.git - git+https://github.com/Unidata/siphon.git diff --git a/ci/environment.yml b/ci/environment.yml index c092cfc..a6a3fec 100644 --- a/ci/environment.yml +++ b/ci/environment.yml @@ -15,3 +15,5 @@ dependencies: - siphon - tqdm - xarray + - pydap + - aiohttp diff --git a/intake_thredds/cat.py b/intake_thredds/cat.py index 22f2a23..ffd89d1 100644 --- a/intake_thredds/cat.py +++ b/intake_thredds/cat.py @@ -39,8 +39,10 @@ def _load(self): ds.name: LocalCatalogEntry( ds.name, 'THREDDS data', - 'netcdf', + # 'netcdf', + 'opendap', True, + # {'urlpath': ds.access_urls['HTTPServer'], 'chunks': None}, {'urlpath': ds.access_urls['OPENDAP'], 'chunks': None}, [], [], diff --git a/requirements.txt b/requirements.txt index 61b3de8..7177bd1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ aiohttp>=3.7 intake-xarray>=0.3 intake>=0.6.0 +pydap siphon diff --git a/tests/test_cat.py b/tests/test_cat.py index 9c2fb38..9def691 100644 --- a/tests/test_cat.py +++ b/tests/test_cat.py @@ -1,4 +1,5 @@ import intake +import intake_xarray import pytest import xarray as xr @@ -23,11 +24,11 @@ def test_init_catalog(thredds_cat_url): def test_entry(thredds_cat_url): cat = intake.open_thredds_cat(thredds_cat_url) entry = cat['err.mnmean.v3.nc'] - assert isinstance(entry, intake.source.base.DataSource) + assert isinstance(entry, intake_xarray.opendap.OpenDapSource) d = entry.describe() assert d['name'] == 'err.mnmean.v3.nc' assert d['container'] == 'xarray' - assert d['plugin'] == ['netcdf'] + assert d['plugin'] == ['opendap'] assert ( d['args']['urlpath'] == 'https://psl.noaa.gov/thredds/dodsC/Datasets/noaa.ersst/err.mnmean.v3.nc' diff --git a/tests/test_source.py b/tests/test_source.py index 9ece1ed..fa39c79 100644 --- a/tests/test_source.py +++ b/tests/test_source.py @@ -14,14 +14,14 @@ def test_thredds_merge(thredds_cat_url): 'ASCAT', 'ASCAT_v1-0_soil-moisture_daily_0-05deg_2007-2011', '00000000', - '*.nc', + '*12.nc', # to speed up only takes all december files ] cat = intake.open_thredds_merged(thredds_cat_url, paths) assert cat.urlpath == thredds_cat_url assert cat.path == paths ds = cat.to_dask() - assert dict(ds.dims) == {'lat': 681, 'lon': 841, 'time': 1826} + assert dict(ds.dims) == {'lat': 681, 'lon': 841, 'time': 155} d = cat.discover() assert set(d['metadata']['coords']) == set(('lat', 'lon', 'time')) assert set(d['metadata']['data_vars'].keys()) == set(