obtain a dedicated API key for testing NREL psm3
See original GitHub issueIs your feature request related to a problem? Please describe. came up in #866 see this comment but related to most PR and testing in general - due to NREL PSM3 throttle limits for the DEMO key the CI’s frequently fail
Describe the solution you’d like
obtain a dedicated API key from NREL developer network and upload it to Azure pipelines as a secret variable, ditto for Travis, then for testing, get this from os.environ[<PVLIB TEST NREL API KEY>] and use it instead of the DEMO key which has severe throttle limits and is shared by everyone
Describe alternatives you’ve considered just live with the test failures, or skip theses tests from the CI’s
Additional context Add any other context or screenshots about the feature request here.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Physical Solar Model (PSM) v3 API | NREL: Developer Network
Physical Solar Model (PSM) v3 (/api/nsrdb/v2/solar/psm3-download). Collect and download, as CSV, a configurable set of solar and meteorological data fields from ...
Read more >NREL API error when fetching solar data (PSM v3 TMY)
We're using the NREL API to fetch solar data through pysam. ... be reproduced by visiting this url (make sure to set your...
Read more >API Key Signup - NREL: Developer Network
API Key Signup ; First Name *. Fill out this field. ; Last Name *. Fill out this field. ; Email *. Enter...
Read more >Cannot get weather file for long = -111.9728826 and latitude ...
The problem we faced is that we can't get the weather file for the ... and <EMAIL> with your NREL Developer API key...
Read more >API calls to developer.nrel.gov - SAM Forum
Is there a limit on how often or how many calls to developer.nrel.gov/api/nsrdb/v2/solar (with tools.FetchResourceFiles) we can make to get psm3 ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Now that you mention it, this pattern could well be the issue:
Those could easily send more than one request per second. Maybe we should wrap the
get_psm3function calls with another function that sleeps before every call? For instanceIf that doesn’t work, here are two ideas, neither of which is nearly as good as understanding the API rate limits:
The API response includes two relevant headers indicating rate limit usage:
Maybe useful for e.g. monkey-patching the network calls in
test_psm3.pyto print out those header values:Click to expand pytest output
I’ve used a retry approach like this before when I wanted to bulk download data from the API and kept getting seemingly spurious timeouts:
Thank you for the confirmation that I’m not crazy @kanderso-nrel. I took a few iterations to be sure of what I was seeing.
To make the tests past consistently the only solutions that I can propose are to put 5 sec timers in front of every API call and/or cut down the number of API calls to the bare minimum. Both aren’t reasons to be excited to be sure. I’m not sure even NREL whitelisting Azure IPs for a higher throughput would be a workable fix. Do you have any other suggestions?
In looking at test_psm3.py some of the tests made me wonder if we were testing pvlib or the API server. Are there any API calls that could be removed to help the situation?