Ouranosinc / xscen

A climate change scenario-building analysis framework.
https://xscen.readthedocs.io/
Apache License 2.0
16 stars 2 forks source link

Exists_in_cat returns True with missing variable #37

Closed sarahclaude closed 2 years ago

sarahclaude commented 2 years ago

Setup Information

Description

DataCatalog.exists_in_cat() returns True if one the variable is in the catalog and the others are missing. @juliettelavoie

Steps To Reproduce

No response

Additional context

No response

Contribution

juliettelavoie commented 2 years ago

exists_in_cat uses the search function of intake ESM. It only checks if search finds at least one dataset with the arguments given. search looks for all dataset that include at least one of the variable you give it. To restrict that, you can pass require_all_on to exists_in_cat in the same way that you would pass it to search.

eg.

pcat.exists_in_cat(require_all_on=['id','processing_level'], processing_level='extracted', id='CMIP6_ScenarioMIP_CSIRO-ARCCSS_ACCESS-CM2_ssp245_r1i1p1f1_global', variable=['tasmax', 'tasmin', 'pr'])