-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add NSRDB GOES v4 to iotools #2378
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
Conversation
What's the best practice for lines like this one that end up too long? Do I simply add GOES_URL = NSRDB_API_BASE + "/api/nsrdb/v2/solar/nsrdb-GOES-aggregated-v4-0-0-download.csv" |
You could use parentheses GOES_URL = NSRDB_API_BASE + ("/api/nsrdb/v2/solar/"
"nsrdb-GOES-aggregated-v4-0-0-download.csv") or just break the string smaller and add them API_STUB = "/api/nsrdb/v2/solar/"
ENDPOINT = "nsrdb-GOES-aggregated-v4-0-0-download.csv"
GOES_URL = (NSRDB_API_BASE
+ API_STUB + ENDPOINT) imo avoid ignoring pep8 warnings or else they become pointless. |
Thanks, @mikofski! |
Co-authored-by: Echedey Luis <80125792+echedey-ls@users.noreply.github.com>
I'm not 100% sure that I set up the tests in See I think it's correct, but I could be misunderstanding the goals of some of the tests. |
Ok, made the switch from "goes4" to "psm4". I haven't done anything with @kandersolar's suggestion for different |
WIP: handful of minor things
Thanks @williamhobbs for iterating with the tests :) Many of the remaining code coverage issues are for API error handling conditions that we might not be able to easily induce, so I'd say let's ignore those. However, it does look like |
@kandersolar, I think I finally addressed all the tests. Not sure about the failing codecov checks, though [edit: I see you just commented on this...]. One note/question: I manually removed the Alpha and Asymmetry columns from the test psm4 csv files (after removing them from the variable map based on #2378). Was simply deleting those columns from the csv files the right thing to do? I honestly can't remember how I created those files originally. |
@kandersolar, yes, I'll work on that. |
It looks like no tests make use of those columns (in the PSM3 tests either). So maybe ideally it would be good to include them, but since there's no special functionality related to those columns that we need to test, I think it's okay to leave them out. |
I think leaving Alpha and Asymmetry columns in was causing |
Ok I see. In that case I think the better solution would have been to add the relevant strings to the list of expected keys, rather than remove the columns from the data file. |
@kandersolar I think it's ready now. |
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.
LGTM. Thanks @williamhobbs for this contribution! It's rare to get as many as six functions added in one PR...
I'll open issues for the follow-up items identified in review.
|
||
|
||
def get_nsrdb_psm4_aggregated(latitude, longitude, api_key, email, | ||
year='2023', time_step=60, |
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 just noticed the default value year='2023'
in this function and some others. Is there a good reason for it? I don't see much convenience in having a default year since presumably most users will override it for the year they actually need anyway. And if it's possible to leave the parameter unspecified, it might funnel careless users towards requesting the wrong year unintentionally.
I think we should change it so that year
does not have a default value for the calendar year (i.e. non-TMY) functions. @williamhobbs @AdamRJensen any thoughts?
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 think that's a mighty fine idea!
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.
Does the NSRDB return an informative error if a year is requested for which there is no data? That might be why a default was included.
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.