Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validators for input arguments in API #68

Open
Peter9192 opened this issue Feb 16, 2021 · 0 comments
Open

Add validators for input arguments in API #68

Peter9192 opened this issue Feb 16, 2021 · 0 comments

Comments

@Peter9192
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant