Skip to content

Add getter/parser for PVGIS hourly-radiation #1186

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 52 commits into from
Jul 14, 2021

Conversation

AdamRJensen
Copy link
Member

@AdamRJensen AdamRJensen commented Mar 7, 2021

  • Closes getter/parser for PVGIS hourly-radiation #849
  • I am familiar with the contributing guidelines
  • Tests added
  • Updates entries to docs/sphinx/source/api.rst 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 and Milestone are assigned to the Pull Request and linked Issue.

Add getter/parser for PVGIS hourly-radiation

@AdamRJensen AdamRJensen changed the title Pvgis hourly Add getter/parser for PVGIS hourly-radiation Mar 7, 2021
@AdamRJensen
Copy link
Member Author

@mikofski @wholmgren Should the tests for the hourly radiation functions just mimick those for the TMY functions?

@mikofski
Copy link
Member

mikofski commented Mar 8, 2021

That's probably okay. I think the goals for testing should be, "have I sent the request correctly?" "Is the response what I expected?" and "did it get parsed right?" Make sure to mark api calls with pytest.remotedata & flaky using the timeout constants from conftest. Thanks. PS i'm sure my tests could be improved. Don't feel constrained to repeat my mistakes ;)

@AdamRJensen
Copy link
Member Author

@kanderso-nrel @mikofski
The pvgis hourly API is able to return data in three different formats (specified by the outputformat keyword): json, csv, and basic.

The basic format is essentially the same as the csv option, but without a header or metadata. Is there any interest in supporting this option?

Note that for PVGIS TMY the basic format has a header, which it is NOT supposed to have according to the development team behind PVGIS.

@AdamRJensen AdamRJensen requested a review from kandersolar June 29, 2021 21:31
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.

Looking good @AdamRJensen, some minor comments below. I think this is ready for a detailed look from someone else now, maybe @mikofski for familiarity with the original PVGIS functions? Though obviously anyone is welcome to review.


Parameters
----------
filename : str, pathlib.Path, or file-like buffer
Copy link
Member

Choose a reason for hiding this comment

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

Without thinking too much about it, one clean approach might be a decorator that does something like (a much simpler version of) pandas's _get_filepath_or_buffer: https://github.com/pandas-dev/pandas/blob/master/pandas/io/common.py#L226

@AdamRJensen AdamRJensen requested a review from wholmgren July 2, 2021 20:26
Copy link
Member

@wholmgren wholmgren left a comment

Choose a reason for hiding this comment

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

A handful of minor and mostly optional things... Thanks @AdamRJensen! Another maintainer can merge when ready.

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.

LGTM thanks for seeing this through @AdamRJensen! Two very minor points below, then I promise I'll hit the merge button.

@kandersolar kandersolar merged commit 1869d87 into pvlib:master Jul 14, 2021
@AdamRJensen AdamRJensen deleted the pvgis_hourly branch August 10, 2021 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getter/parser for PVGIS hourly-radiation
4 participants