Skip to content

Commit 807d03a

Browse files
committed
add test
1 parent 83b2f5d commit 807d03a

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import intake_esgf
2+
from intake_esgf import ESGFCatalog
3+
4+
# CMIP6Plus is the same as CMIP6, this is just to satisfy coverage
5+
6+
7+
def test_cmip6_discovery():
8+
"""
9+
Test a small search that will exercise the discovery functions of intake-esgf.
10+
"""
11+
intake_esgf.conf.set(no_indices=True, indices={"ESGF2-US-1.5-Catalog": True})
12+
cat = ESGFCatalog().search(
13+
project="CMIP6Plus",
14+
experiment_id=["hist-lu", "hist-aer"],
15+
source_id=["E3SM-2-1", "HadGEM3-GC31-LL"],
16+
member_id=["f2023-r6i1p1f1", "f2023-r11i1p1f1", "f2023-r11i1p1f3"],
17+
variable_id=["tasmax", "mrsofc"],
18+
)
19+
assert len(cat.df) == 3
20+
assert len(cat.model_groups()) == 3
21+
cat.remove_ensembles()
22+
assert len(cat.df) == 2
23+
assert len(cat.model_groups()) == 2

0 commit comments

Comments
 (0)