Skip to content

Standardize pvgis_tmy to return (data,meta) #2470

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

Merged
merged 3 commits into from
Jun 5, 2025

Conversation

AdamRJensen
Copy link
Member

@AdamRJensen AdamRJensen commented Jun 4, 2025

  • I am familiar with the contributing guidelines
  • 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.

The pvlib.iotools.get_pvgis_tmy and read_pvigs_tmy currently do not follow the iotools standard convention of returning a tuple with (data,meta). Instead, the functions currently output (data,moths_selected,inputs,meta), which is causing a lot of confusion for new users, particularly this is a major pain point during intro tutorials. This PR introduces a breaking change by changing the output of the functions to follow the iotools standard convention.

Related to #2462.

@AdamRJensen AdamRJensen added the io label Jun 4, 2025
@AdamRJensen AdamRJensen requested a review from kandersolar June 5, 2025 01:55
@kandersolar kandersolar added this to the v0.12.1 milestone Jun 5, 2025
@kandersolar kandersolar added remote-data triggers --remote-data pytests api labels Jun 5, 2025
Copy link
Member

@kandersolar kandersolar left a comment

Choose a reason for hiding this comment

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

This will make this function easier to use for many people, I am sure!

A few minor comments below.

Comment on lines +396 to +401
# Re-create original outputs (prior to #2470)
months_selected = meta['months_selected']
inputs = meta['inputs'].copy()
del inputs['descriptions']
meta['inputs'] = meta['inputs']['descriptions']
del meta['months_selected']
Copy link
Member

Choose a reason for hiding this comment

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

This seems a little hacky to me. Ok if it's just to get the API change in for this release, but let's at least open an issue to update the expected values to match the new format.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in #2472

@kandersolar kandersolar merged commit d702353 into pvlib:main Jun 5, 2025
29 of 30 checks passed
@AdamRJensen AdamRJensen deleted the standardize-pvgis-tmy-ouputs branch June 5, 2025 17:29
@kandersolar kandersolar modified the milestones: v0.12.1, v0.13.0 Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api io remote-data triggers --remote-data pytests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants