Add dataset option to get_era5#2780
Conversation
| } | ||
| } | ||
| slug = "processes/reanalysis-era5-single-levels-timeseries/execution" | ||
| slug = f"processes/{dataset}/execution" |
There was a problem hiding this comment.
This means that if somebody copies the dataset parameter with a typo (e.g., an space) the error is harder to spot. I suggest to add a guardrail right before (if dataset not in {"...", "..."}. In addition to that, the new function signature is not backwards-compatible in those calls that provided positional parameters up to map_variables (inclusive). The guardrail would provide a meaningful message in this case, where dataset=True/False.
There was a problem hiding this comment.
Hmm, I like the idea, but overall I'm against it. My reason is that if a new compatible dataset is added, then users would not be able to use the function. For example, I was not aware that the ERA5-Land had become an option.
Indeed, it is not backward compatible, this is why I am lobbying for making most input parameters keyword only.
There was a problem hiding this comment.
I admit to not suggesting that to avoid being pedantic 😆
I don't think it's the right time for this release, but I remember PyVista has [at least in v0.46.something] a deprecation decorator that warns against the use of positional arguments (while it also allowed passing some). Just in case it's helpful in the future if iotools API was to be standardized.
Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com>
| the available variables. Data are available on a 0.25° x 0.25° grid. | ||
| This API [2]_ provides a subset of parameters of the full ERA5 datasets, | ||
| see [3]_ for available variables. A comparison of ERA5 and ERA5-land is | ||
| available in [4]_. |
There was a problem hiding this comment.
What do you think about adding a Notes section to briefly explain the problem with coastal grid points?
docs/sphinx/source/whatsnewfor all changes. Includes link to the GitHub Issue with:issue:`num`or this Pull Request with:pull:`num`. Includes contributor name and/or GitHub username (link with:ghuser:`user`).remote-data) and Milestone are assigned to the Pull Request and linked Issue.This PR adds a new parameter to the
get_era5function, such that users can change the dataset to be ERA5-land instead of ERA5.