Skip to content

Add dataset option to get_era5#2780

Open
AdamRJensen wants to merge 8 commits into
pvlib:mainfrom
AdamRJensen:add-era5-land
Open

Add dataset option to get_era5#2780
AdamRJensen wants to merge 8 commits into
pvlib:mainfrom
AdamRJensen:add-era5-land

Conversation

@AdamRJensen

@AdamRJensen AdamRJensen commented Jun 10, 2026

Copy link
Copy Markdown
Member
  • I am familiar with the contributing guidelines
  • I attest that all AI-generated material has been vetted for accuracy and is in compliance with the pvlib license
  • Tests added
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for 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`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

This PR adds a new parameter to the get_era5 function, such that users can change the dataset to be ERA5-land instead of ERA5.

@AdamRJensen AdamRJensen added this to the v0.15.2 milestone Jun 10, 2026
@AdamRJensen AdamRJensen added io remote-data triggers --remote-data pytests labels Jun 10, 2026
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jun 10, 2026
Comment thread pvlib/iotools/era5.py Outdated
Comment thread pvlib/iotools/era5.py Outdated
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jun 10, 2026
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jun 10, 2026
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jun 10, 2026
Comment thread pvlib/iotools/era5.py Outdated
Comment thread pvlib/iotools/era5.py Outdated
Comment thread pvlib/iotools/era5.py
}
}
slug = "processes/reanalysis-era5-single-levels-timeseries/execution"
slug = f"processes/{dataset}/execution"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

AdamRJensen and others added 2 commits June 11, 2026 10:28
Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com>
Comment thread pvlib/iotools/era5.py
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]_.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding a Notes section to briefly explain the problem with coastal grid points?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

io remote-data triggers --remote-data pytests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants