We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0080140 commit 1e346e7Copy full SHA for 1e346e7
intake_xarray/tests/test_derived.py
@@ -1,3 +1,23 @@
1
+import os
2
+import pytest
3
+
4
+from intake import open_catalog
5
+from xarray.tests import assert_allclose
6
7
8
+# Function used in xarray_source_sel entry in catalog.yaml
9
def _sel(ds, indexers: str):
10
"""indexers: dict (stored as str) which is passed to xarray.Dataset.sel"""
11
return ds.sel(eval(indexers))
12
13
14
+@pytest.fixture
15
+def catalog():
16
+ path = os.path.dirname(__file__)
17
+ return open_catalog(os.path.join(path, "data", "catalog.yaml"))
18
19
20
+def test_catalog(catalog):
21
+ expected = catalog["xarray_source"].read().sel(lat=20)
22
+ actual = catalog["xarray_source_sel"].read()
23
+ assert_allclose(actual, expected)
0 commit comments