Repository navigation
Fix kimber cleaning threshold and grace period resolution dependence - #2943
Open
CameronGordonn wants to merge 2 commits into
Open
CameronGordonn wants to merge 2 commits into
CameronGordonn wants to merge 2 commits into
Conversation
Hey @CameronGordonn! 🎉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 |
Loop over rainy time steps only, since a step without rain cannot trigger a cleaning event. Note the daily grace period change and link the PR in the whatsnew entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Heads up: #2937 (fixing #2935) also changes the timestep code in kimber and removes rain_index_vals, which this PR uses. Whichever merges first, I'll update the other's conflict. On my side, the fix is to pass rainfall.index - rainfall.index[0] to the event helper, which also works for tz-naive data. |
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`).remote-data) and Milestone are assigned to the Pull Request and linked Issue.No public API changes, so no updates to
docs/sphinx/source/reference.Fixes the two problems in #2796 with
pvlib.soiling.kimber:cleaning_thresholdnow cleans the panels.cleaning_thresholdof new rain has fallen withinrain_accum_period, and the grace period lastsgrace_perioddays from that time step.Why rain is "used up" by an event. Previously, every time step where the rolling 24 h sum exceeded the threshold counted as an event, so the grace period effectively started at the last such step. With finer data there are more such steps, and drizzle after a storm keeps the sum high and pushes the start later. For the hourly Greensboro TMY3 test data, main flags 1950 event hours; this PR flags 251. Counting each threshold's worth of rain once removes that dependence. With daily input and the default 24 h window, it reduces exactly to Kimber (2006)'s rule that a day is a cleaning event if its rainfall meets the threshold (
test_kimber_cleaning_events_daily).Changes in results.
greensboro_kimber_soil_nowash.datandgreensboro_kimber_soil_manwash.datwere regenerated by runningkimberfrom this branch on the same TMY3 input and wash date as the existing tests. 634 and 262 of the 8760 hourly values change.grace_perioddays after the event day instead ofgrace_period - 1, consistent with sub-daily input. This is noted in the what's new entry.Performance. The event search is a loop because each event resets the running sum, but it only visits time steps with rain. On a year of 1-minute data where rain falls in 1–5% of minutes, it takes about 0.04–0.11 s (about 0.03–0.04 s on main). The worst case, with rain every minute, takes about 1.5 s.
🤖 Generated with Claude Code