Skip to content

Improve guess output template (fixes #231)

Split into two commits, first one contains fix for the issue, the second commit contains the test setup.


Issue fix: Reusing doc and some code from (!155 (closed)), adding two new functions inside guess_output_template(...):

base_merger: takes the list of bases and generates a single output base if possible. For the case where the are files both from historical and scenario data, the only difference in the base names should be a keyword, such as 'historical' or 'rcp45', somewhere in the middle. In that case the code will try to combine those into one in the final template: 'historical-rcp45'. I'm using regex here since I want to find rcp/ssp scenario keywords with different numbers.

add_frequency: adds {frequency} to the base either by replacing an already occurring frequency keyword (for now only 'day'), or by adding it to the end.


Tests:

I've added pytest to the dependecies list in the environment.yml file. However, it seems neither climix nor the tests will run without installing climix first (there are additional dependencies in setup.py that must be installed before climix will work). Is this 'ok' for now?

Merge request reports