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

Create pvlib.iotools.get_solrad #1967

Merged
merged 17 commits into from Mar 5, 2024
Merged

Conversation

kandersolar
Copy link
Member

@kandersolar kandersolar commented Feb 9, 2024

  • [ ] Closes #xxxx
  • 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.

SOLRAD is a network of ground stations in the US similar to SURFRAD. SOLRAD data is available on the NOAA website in the form of daily files which pvlib-python can fetch and parse using read_solrad. However, this requires the user to construct each daily file URL manually and iteratively retrieve files, which is a minor annoyance.

This PR creates a get_solrad function to wrap the existing read_solrad function. It constructs the necessary filenames based on the supplied date range, iteratively calls read_solrad, returns a single concatenated dataframe.

Copy link
Member

@AdamRJensen AdamRJensen left a comment

Choose a reason for hiding this comment

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

Would be nice with a "See Also" section in both the read and get function documentation.

pvlib/iotools/solrad.py Outdated Show resolved Hide resolved
pvlib/iotools/solrad.py Outdated Show resolved Hide resolved
pvlib/iotools/solrad.py Outdated Show resolved Hide resolved
@kandersolar kandersolar marked this pull request as ready for review February 9, 2024 20:26
@kandersolar kandersolar added the remote-data triggers --remote-data pytests label Feb 9, 2024
@kandersolar kandersolar added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Feb 9, 2024
@kandersolar kandersolar added this to the v0.10.4 milestone Feb 9, 2024
@kandersolar kandersolar added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Feb 9, 2024
pvlib/iotools/solrad.py Outdated Show resolved Hide resolved
Copy link
Member

@AdamRJensen AdamRJensen left a comment

Choose a reason for hiding this comment

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

Nicely done!

Leaving this PR open for about a weeks time for anyone else to review

@kandersolar kandersolar added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Mar 5, 2024
@kandersolar kandersolar added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Mar 5, 2024
@kandersolar kandersolar added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Mar 5, 2024
@kandersolar
Copy link
Member Author

@AdamRJensen this PR is now updated to account for #1968. It also fixes an issue with #1968 where trying to read_solrad a url that 404s raised ValueError: could not convert string to float: '<html' instead of HTTPError: 404 Client Error.

Take a look and merge if it looks good to you?

@AdamRJensen AdamRJensen merged commit 923e025 into pvlib:main Mar 5, 2024
41 checks passed
@kandersolar kandersolar deleted the get_solrad branch March 5, 2024 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement io remote-data triggers --remote-data pytests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants