Addressing unequal times error from pvlib.temperature.prilliman with no leap day
See original GitHub issueIs your feature request related to a problem? Please describe.
When using pvlib.temperature.prilliman()
, if the weather data does not include leap day (e.g., using 2020 PSM3 from pvlib.iotools.get_psm3()
with the default leap_day=False
), it returns:
NotImplementedError: algorithm does not yet support unequal times. consider resampling your data.
This could be a common scenario and could be confusing to the user.
Describe the solution you’d like There are several possible solutions:
- Modify the error text to always say something like
NotImplementedError: algorithm does not yet support unequal times. consider resampling your data. check to make sure your data includes leap day for leap year(s).
- Check to see if leap day is missing and tailor the error message accordingly (e.g., add
leap day is missing from your data.
to the error message). - Check to see if leap day is missing, automatically fill it in somehow (e.g., repeat Feb 28), then remove it from the results before returning the output time series.
- Same as 3, but also notify the user that this has happened. Depending on time zone of the weather data, there might be a discontinuity in the resulting smoothed temperature after removing leap day (I think?).
Describe alternatives you’ve considered
Manually fill in leap day or repeat weather data query with leap day included (e.g., use leap_day=True
with pvlib.iotools.get_psm3()
).
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
What's New — pvlib python 0.9.3 documentation
Improve error message about uneven time intervals for detect_clearsky() ... Added pvlib.temperature.prilliman() for modeling cell temperature at short time ...
Read more >pvlib.temperature — pvlib python 0.9.3 documentation
The ``temperature`` module contains functions for modeling temperature of ... Data with irregular time steps (including from data gaps, missing leap days, ...
Read more >pvlib.temperature.prilliman
This implementation requires the time series inputs to be regularly sampled in time with frequency less than 20 minutes. Data with irregular time...
Read more >pvlib.temperature.noct_sam — pvlib python 0.9.3 documentation
Cell temperature model from the System Advisor Model (SAM). The model is described in 1, Section 10.6. Parameters. poa_global (numeric) – Total incident ......
Read more >pvlib.temperature.sapm_cell_from_module
See 1 for details on the Sandia Array Performance Model. Parameters. module_temperature (numeric) – Temperature of back of module surface [C]. poa_global ( ......
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 FreeTop 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
Top GitHub Comments
Checking for missing leap days and trying to correct for them seems out of scope for
temperature.prilliman
to me. I agree with @adriesse, better to leave that can of worms to the user. But I am certainly in favor of improving that error message to mention leap days and perhaps data gaps in general. Maybe something like this?We might also want to change “unequal times” to something else while we’re at it. Note that this same error message is used in
detect_clearsky
, so we should make sure the message continues to be appropriate for both functions.As an aside, I suspect
leap_day=False
is rooted in matching the PSM3 API’s decision to set it False by default. But +1 to a new issue to discuss changing it on the pvlib side.@williamhobbs in regards to:
Then I recommend that is made a separate issue.