Skip to content

PSM4 get_ functions: remove default values for year #2471

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 2 commits into from
Jun 5, 2025

Conversation

kandersolar
Copy link
Member

  • Addresses Add NSRDB GOES v4 to iotools #2378 (comment)
  • I am familiar with the contributing guidelines
  • [ ] Tests added
  • [ ] Updates entries in docs/sphinx/source/reference for API changes.
  • [ ] 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.

See #2378 (comment).

Note that these functions haven't been included in a release yet, so no problem to change default values like this.

@kandersolar kandersolar added this to the v0.12.1 milestone Jun 5, 2025
@kandersolar kandersolar added io remote-data triggers --remote-data pytests labels Jun 5, 2025
@kandersolar kandersolar requested a review from AdamRJensen June 5, 2025 15:51
Comment on lines -317 to -319
# convert to string to accomodate integer years being passed in
year = str(year)

Copy link
Member

Choose a reason for hiding this comment

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

Why is this only removed for one of the functions? I see this is present for the other three functions as well.

I support the removal since this line doesn't seem to be necessary, but we should be consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

The inconsistency is because this is the TMY function, where year is always a string ("tmy", "tgy-2020"). The other three deal with calendar years.

Copy link
Member Author

Choose a reason for hiding this comment

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

On second thought, it's not needed in any of these functions anymore. It was a copy/paste from get_psm3, where the year input was inspected to determine the relevant API endpoint, and being a string facilitated that inspection. For PSM4 it serves no purpose since we have one function per endpoint here. All of them are now removed.

Copy link
Member

@AdamRJensen AdamRJensen Jun 5, 2025

Choose a reason for hiding this comment

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

Exactly! I just ran the tests locally with all the string conversion removed and tests are passing.

@kandersolar kandersolar added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Jun 5, 2025
@kandersolar kandersolar merged commit e4d3aa4 into pvlib:main Jun 5, 2025
36 of 54 checks passed
@kandersolar kandersolar deleted the psm4-year branch June 5, 2025 19:28
@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
io remote-data triggers --remote-data pytests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants