Fix mutable default arguments in sensor_analysis and clearsky_analysis#489
Closed
Copilot wants to merge 2 commits intodevelopmentfrom
Closed
Fix mutable default arguments in sensor_analysis and clearsky_analysis#489Copilot wants to merge 2 commits intodevelopmentfrom
Copilot wants to merge 2 commits intodevelopmentfrom
Conversation
Co-authored-by: cdeline <23244088+cdeline@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Work in progress to address feedback from review on release 3.2.0
Fix mutable default arguments in sensor_analysis and clearsky_analysis
Mar 5, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #489 +/- ##
===============================================
+ Coverage 96.90% 96.92% +0.01%
===============================================
Files 12 12
Lines 2328 2341 +13
===============================================
+ Hits 2256 2269 +13
Misses 72 72 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Collaborator
|
I dont like these proposed changes. The 'issue' that is solved is not really an issue because our mutable types that gets passed in like the 'yoy_kwargs' dict is only ever read, never written or updated. And the downside is that the proposed change moves important default behavior deeper into the function and makes it harder to trace the logic and document how to interact with the TA object for the user. Canceling this 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.
sensor_analysisandclearsky_analysisused mutable default arguments (analyses=[...],yoy_kwargs={...},srr_kwargs={}), risking state leakage between calls if those objects were mutated.Changes
Nonein bothsensor_analysisandclearsky_analysis["yoy_degradation"],{"label": "right"},{}) inside the method bodySame pattern applied to
clearsky_analysis.Checklist
__init__.py🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.