eWaterCycle / eWaterCycle/era5cli

Add validators for input arguments in API

Open
#68 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
59
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Currently there are several ad-hoc checks for incompatible combinations of parameters, such as:

- ERA5-land is not compatible with the preliminary back extension
- statistics option is ignored if ensemble is False
- variable names must match the table (e.g. snow_cover only accepted if --land==True)
- for monthly data there is a check for missing vars
- etc.

This leads to double checking and unclear state (can we assume .... at this place in the code?) and at the same time several incompatible combinations may silently pass.

It would be good to check validate the input on initialization of the Fetch class. There it will verify both the CLI or API input. Then in the rest of the code we can assume valid input.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.