feat: add original-vs-reconstructed compare plot (plot_compare) - #96
Closed
FBumann wants to merge 1 commit into
Closed
feat: add original-vs-reconstructed compare plot (plot_compare)#96FBumann wants to merge 1 commit into
FBumann wants to merge 1 commit into
Conversation
…nResult Adds a plotly convenience plot built on the compare()/to_dataframe() helpers, the most common check after aggregating. Overlays original (dotted) vs reconstructed (solid), colours by cluster column, and facets over slice dims. - kind="timeseries" (default) or "duration_curve" (sorted descending) - **sel selects a subset (e.g. variable="solar"); omit to plot all columns - optional plotly dependency guarded with a helpful message, matching TuningResult.plot() - getting-started notebook demonstrates the one-call helper Closes #95 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Closes #95.
Adds
AggregationResult.plot_compare()— a one-call plotly figure for the most common post-aggregation check.Note
Stacked on #93. This builds on the
compare()/to_dataframe()helpers from that PR, so it's based onfeat/compare-original-reconstructed, notmain. Merge #93 first, then rebase/retarget this ontomain(GitHub will offer to retarget automatically once #93 lands).API
to_dataframe().variantwhen there's no cluster dim); facets over slice dims (period/scenario) when present.kind="timeseries"(default) orkind="duration_curve"(each series sorted descending).**selselects a subset, e.g.plot_compare(variable="solar"); omit to plot all columns.TuningResult.plot().Deviation from the issue's sketch
The issue proposed
plot_compare(variable=None, ...). I used**selinstead so it composes with the existingcompare(**sel)/to_dataframe(**sel)and handles arbitrary/multiple cluster-dim names (not just one calledvariable).plot_compare(variable="solar")still works exactly as sketched.Tests
TestPlotCompare(5): faceting over a slice dim, single-column selection, duration curve, no-cluster-dim colouring, invalid-kind error. Full suite: 533 passed / 4 skipped. mypy + ruff clean; getting-started notebook executes end-to-end and demonstrates the helper.🤖 Generated with Claude Code