Repository navigation
Conversation
…aive data Fixes pvlib#2935 In pvlib.tools._get_sample_intervals, consecutive timestamp deltas are now computed using direct DatetimeIndex subtraction rather than stripping timezones via tz_localize(None), preventing spurious 61-minute interval steps during Daylight Saving Time (DST) transitions. In pvlib.soiling.kimber, timestep intervals and day fractions are computed directly from index timedelta without calling tz_convert(None), preventing TypeError when given timezone-naive Series. Added regression tests in test_clearsky, test_temperature, test_soiling, and test_tools.
Hey @pranaysb! 🎉Thanks for opening your first pull request! We appreciate your If AI is used for any portion of this PR, you must vet the content Finally, be sure the PR description includes the PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs/sphinx/source/whatsnewfor 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`).Description
Fixes two issues identified in #2935 following the pandas 3.1.0 compatibility updates:
detect_clearsky&temperature.prillimanon DST transition days: Inpvlib.tools._get_sample_intervals, consecutive sample intervals were previously computed usingtimes.tz_localize(None).to_numpy(). Stripping timezone metadata converted timestamps to local wall-clock time, causing spring-forward daylight saving transitions to register as a 61-minute step and triggeringNotImplementedError: algorithm does not yet support unequal time intervals. Consecutive intervals are now calculated using directDatetimeIndexsubtraction(times[1:] - times[:-1]) / pd.Timedelta('60s'), which correctly preserves elapsed physical duration for timezone-aware series across DST transitions while supporting timezone-naive indices.soiling.kimberon timezone-naive data: Inpvlib.soiling.kimber, callingrainfall.index.tz_convert(None)failed on timezone-naive inputs withTypeError: Cannot convert tz-naive timestamps. Timestep intervals and day fractions are now calculated directly fromrainfall.index[1] - rainfall.index[0] / pd.Timedelta(days=1), supporting both timezone-naive and timezone-aware indexes.Testing
tests/test_clearsky.py,tests/test_temperature.py,tests/test_soiling.py, andtests/test_tools.py.pytest.flake8.