coecms / clef

https://clef.readthedocs.io
7 stars 3 forks source link

experiment and experiment_family should be mutually exclusive #89

Closed paolap closed 2 years ago

paolap commented 5 years ago

If you run a CMIP5 query both remote or local passing both experiment and experiment_family it won't behave as a user might expect:

[pxp581@raijin3 ~]$ clef cmip5 -m CMCC-CM -e historical --experiment_family RCP -t Omon --ensemble r1i1p1 -v tos No matches found on ESGF, check at https://esgf.nci.org.au/search/esgf-nci?query=&distrib=True&replica=False&latest=True&experiment_family=RCP&project=CMIP5&ensemble=r1i1p1&experiment=historical&model=CMCC-CM&cmor_table=Omon&variable=tos

[pxp581@raijin3 ~]$ clef cmip5 -m CMCC-CM -e rcp45 --experiment_family RCP -t Omon --ensemble r1i1p1 -v tos /g/data1b/al33/replicas/CMIP5/combined/CMCC/CMCC-CM/rcp45/mon/ocean/Omon/r1i1p1/v20120518/tos /g/data1b/al33/replicas/CMIP5/combined/CMCC/CMCC-CM/rcp45/mon/ocean/Omon/r1i1p1/v20170725/tos

This is because both queries apply an AND filter between different arguments and in the first case rather that returning RCPs + historical experiments returns nothing. In the second returns only rcp45.

we should probably eventually handle this better so a user understand what's going on rather than getting no results from the queries. I doesn't look like click can do this unless we create a new option subclass to add mutually exclusive arguments which might be painful to maintain. We could maybe raise a ClefException instead if a user pass both options.

Interestingly this is also showing a current issues with these files two versions are returned when only the latest should be there, that's an NCI issue though

paolap commented 5 years ago

Need to check if it's possible to fix fix at least in local and add examples to demo notebook!

paolap commented 4 years ago

Added examples in clef_demo notebook and fixed an issue with the click argument