question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Addressing unequal times error from pvlib.temperature.prilliman with no leap day

See original GitHub issue

Is 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:

  1. 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).
  2. 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).
  3. 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.
  4. 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:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kanderso-nrelcommented, Jun 22, 2022

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?

algorithm does not yet support unequal times. consider resampling your data and checking for jumps from missing periods, leap days, etc.

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.

1reaction
AdamRJensencommented, Jun 22, 2022

@williamhobbs in regards to:

Separately, I also like the idea of changing pvlib.iotools.get_psm3() so that the default is leap_day=True. Should that suggestion be opened as a separate issue? I wonder if there are any compelling reasons to keep it as False, other than the fact that other tools (e.g., NREL SAM) can’t handle leap day.

Then I recommend that is made a separate issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found