Conversation
Ports the CVXPY seasonal-trend decomposition prototype into a new rdtools.signal_decomposition module and wires it end-to-end through TrendAnalysis. New module (rdtools/signal_decomposition.py): - Public degradation() entry point returning (Rd_pct, Rd_CI, sd_trend_results) - Three trend types: linear, pwl, monotone - Four loss functions: l2, l1, huber, quantile - Missing data handled natively via masked equality constraint - Stability analysis: analyze_fit_stability, get_valid_endpoints, plot_stability - Plotting/display: plot_decomposition, animate_degradation, format_degradation_report - log_transform path via extract_degradation_rate_log TrendAnalysis wiring (rdtools/analysis_chains.py): - _signal_decomposition_degradation private method - sensor_analysis / clearsky_analysis accept 'signal_decomposition' in analyses list and sd_kwargs passthrough - plot_signal_decomposition_summary method Dependencies: - cvxpy >= 1.7.5 and spcqe >= 0.3.0 added as hard runtime dependencies - scipy floor raised from 1.8.1 to 1.13.0 (required by cvxpy's transitive deps) - cvxpy and spcqe excluded from check_dependencies.py min-pin enforcement (their transitive scipy requirement is incompatible with pinning an exact lower-bound version alongside scipy==1.13.0 on Python 3.10) Tests and docs: - rdtools/test/signal_decomposition_test.py (29 tests) - Additions to analysis_chains_test.py (fixtures, plot tests, bad-case coverage) - api.rst updated with Signal Decomposition section and new TrendAnalysis method
Collaborator
Author
|
Just finishing up examples and package dependency testing. Ready for general review. Open item: minimum scipy version support. |
…repeated calls to analysis_chains.TrendAnalysis.sensor_analysis
…r the end of the trend window.
analyze_fit_stability and animate_degradation both call make_problem(y_full[:n], **make_problem_kwargs). When callers pass sd_trend_results['args'] directly (which includes 'y' because _get_kwargs captures the full make_problem signature), this caused a "multiple values for argument 'y'" TypeError. Strip 'y' from the dict at the top of each function so passing args through is always safe.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #518 +/- ##
==========================================
- Coverage 96.79% 92.45% -4.34%
==========================================
Files 12 13 +1
Lines 2342 3050 +708
==========================================
+ Hits 2267 2820 +553
- Misses 75 230 +155 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…or signal decomposition models
dict of CI arrays rather than a single [lo, hi] for the overall rate. degradation() merges these into sd_trend_results as ci_<rate_key> entries, giving ci_rate_pre/post_pct_yr for pwl and ci_rate_yearly_pct_yr (shape 2×n_years) for monotone. Rd_CI is unchanged.
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.
Ports the CVXPY seasonal-trend decomposition prototype into a new
rdtools.signal_decomposition module and wires it end-to-end through
TrendAnalysis.
New module (rdtools/signal_decomposition.py):
TrendAnalysis wiring (rdtools/analysis_chains.py):
list and sd_kwargs passthrough
Dependencies:
(their transitive scipy requirement is incompatible with pinning an exact
lower-bound version alongside scipy==1.13.0 on Python 3.10)
Tests and docs:
rdtools/test/signal_decomposition_test.py (29 tests)
Additions to analysis_chains_test.py (fixtures, plot tests, bad-case coverage)
api.rst updated with Signal Decomposition section and new TrendAnalysis method
Code changes are covered by tests
Code changes have been evaluated for compatibility/integration with TrendAnalysis
[ ] New functions added to__init__.pyWe are intentionally not doing this. The new function should be imported as
rdtools.signal_decomposition.degradation/from rdtools.signal_decomposition import degradationto avoid clashes with therdtools.degradationmodule.API.rst is up to date, along with other sphinx docs pages
Example notebooks are rerun and differences in results scrutinized
Updated changelog