-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add NASA POWER to iotools #2500
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
base: main
Are you sure you want to change the base?
Conversation
@AdamRJensen could you give some first feedback on this? Also, should there also be a |
I suggest just adding a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial review
Co-authored-by: Adam R. Jensen <[email protected]>
Co-authored-by: Adam R. Jensen <[email protected]>
Co-authored-by: Adam R. Jensen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments, overall looks pretty good to me! Seems like the API is a little slow but not terrible: 16 seconds for a year of data.
Co-authored-by: Kevin Anderson <[email protected]>
When running pytest locally, it says that the first test is skipped. Any ideas why this is (and also, is it a problem)? |
@IoannisSifnaios that's due to the flags that make the iotools tests only run when explicitly requested. The pytest command you must run is in
cov parameters are just for the coverage file, you don't need em. |
I guess based on the workflow description, there should also be a |
Yup, that's right! Edit: in fact, see it's one of the instructions (the last one) on the PR template |
Co-authored-by: Kevin Anderson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick in Whatsnew. LGTM 💯
@@ -19,7 +19,8 @@ Bug fixes | |||
|
|||
Enhancements | |||
~~~~~~~~~~~~ | |||
|
|||
* Added function :py:func:`~pvlib.iotools.get_nasa_power` to retrieve data from NASA POWER. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Added function :py:func:`~pvlib.iotools.get_nasa_power` to retrieve data from NASA POWER. | |
* Add :py:func:`pvlib.iotools.get_nasa_power` to retrieve data from NASA POWER free API. |
Use imperative mood for the changelogs (latest trend in pvlib, e.g. recommended by https://common-changelog.org/)
I suggest keeping the iotools namespace visible, I think it is valuable in the context of new functionality. And stating it's a free API - for me, that guarantees it's worth considering 🤑
|
||
|
||
def get_nasa_power(latitude, longitude, start, end, | ||
parameters=DEFAULT_PARAMETERS, community='re', url=URL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parameters=DEFAULT_PARAMETERS, community='re', url=URL, | |
parameters=DEFAULT_PARAMETERS, *, community='re', url=URL, |
I suggest adding an asterisk which forces the remaining parameters to be specified as keywords only (not positional). The motivation is that this makes it easier to add and deprecate parameters.
@kandersolar let me hear your opinion on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been reluctant to introduce *
(and /
) into function signatures:
- I have not encountered it much in role model packages like scipy (though perhaps it is there and I do not notice)
- It doesn't seem to me that we should force a code style opinion onto users
- It does not come with any obvious benefit to pvlib's maintenance
However, item 3 is partly rebutted by the point about deprecation, which is a good one that I had not considered.
I don't feel strongly about it. To me it seems reasonable to use *
in this case, and if others think it's a good idea to start using it more in pvlib then I won't object, although I think in some cases there could be disagreement about what position in the parameters list it should take.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright let's try it out here. It's easy remove but adding it later would be a breaking change. I'm partly advocating for it because I'm toying with the idea of adding a parameter for allowing setting the index to be a time interval/period index.
|
||
|
||
def get_nasa_power(latitude, longitude, start, end, | ||
parameters=DEFAULT_PARAMETERS, community='re', url=URL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The url should be the last parameter (standard iotools practice)
docs/sphinx/source/reference
for API changes.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`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.This PR adds a function to get irradiance and weather data from NASA POWER. read_the_docs_link