Skip to content

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.

@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
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
@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.

2 participants