Skip to content

Commit df051d1

Browse files
Merge branch 'main' into to-iris
1 parent 93daea8 commit df051d1

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

docs/source/how-to/enforce-search-query-criteria-via-require-all-on.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ kernelspec:
1212
```{code-cell} ipython3
1313
import intake
1414
15-
url = "https://raw.githubusercontent.com/intake/intake-esm/main/tutorial-catalogs/GOOGLE-CMIP6.json"
15+
url = "https://storage.googleapis.com/cmip6/pangeo-cmip6.json"
1616
cat = intake.open_esm_datastore(url)
1717
cat
1818
```
@@ -31,7 +31,7 @@ multiple experiment_ids from the Omon table_id, all from 3 different source_ids:
3131
```{code-cell} ipython3
3232
# Define our query
3333
query = dict(
34-
variable_id=["tos", "o2"],
34+
variable_id=["thetao", "o2", "tos"],
3535
experiment_id=["historical", "ssp585"],
3636
table_id=["Omon"],
3737
source_id=["ACCESS-ESM1-5", "AWI-CM-1-1-MR", "FGOALS-f3-L"],
@@ -54,10 +54,10 @@ cat_subset.df.groupby("source_id")[["experiment_id", "variable_id", "table_id"]]
5454
```
5555

5656
As you can see, the search results above include source_ids for which we only
57-
have one of the two variables, and one or two of the two
57+
have one or two of the three variables, and one of the two experiment ids.
5858

59-
We can tell intake-esm to discard any source_id that doesn’t have both variables
60-
`["tos", "o2"]` and both experiments
59+
We can tell intake-esm to discard any source_id that doesn’t have all three variables
60+
`["thetao", "o2", "tos"]` and both experiments
6161
`["historical", "ssp585"]` by passing `require_all_on=["source_id"]`
6262
to the search method:
6363

tests/test_core.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,6 @@ def test_catalog_search_columns_with_iterables(path, columns_with_iterables, que
259259
assert len(new_cat) == expected_size
260260

261261

262-
@pytest.mark.parametrize(
263-
'path, columns_with_iterables, query, expected_size',
264-
[
265-
(access_columns_with_iterables_cat, ['variable'], {'variable': ['aice_m']}, 1),
266-
],
267-
)
268-
def test_catalog_search_columns_with_iterables(path, columns_with_iterables, query, expected_size):
269-
cat = intake.open_esm_datastore(path, columns_with_iterables=columns_with_iterables)
270-
new_cat = cat.search(**query)
271-
assert len(new_cat) == expected_size
272-
273-
274262
def test_catalog_with_registry_search():
275263
cat = intake.open_esm_datastore(zarr_cat_aws_cesm, registry=registry)
276264
new_cat = cat.search(variable='FOO')

tests/test_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_open_dataset_kerchunk(kerchunk_file=kerchunk_file):
9191
urlpath=kerchunk_file,
9292
varname=None,
9393
xarray_open_kwargs=xarray_open_kwargs,
94-
).compute()
94+
)
9595
assert isinstance(ds, xarray.Dataset)
9696

9797

0 commit comments

Comments
 (0)