feat: support custom colors (Series/dict) in plot_plotly and fix load… - #639
Open
nader-00 wants to merge 9 commits into
Open
feat: support custom colors (Series/dict) in plot_plotly and fix load…#639nader-00 wants to merge 9 commits into
nader-00 wants to merge 9 commits into
Conversation
… scaling - plot_plotly accepts pd.Series or dict for line_color/node_color - unmatched elements fall back to grey - string-based options guarded with isinstance checks - timeseries: scale loads by p_set instead of annual_consumption
… annual_consumption - Allow pd.Series or dict for line_color and node_color in plot_plotly, falling back to grey for unmatched elements - Add tests for custom color inputs in test_plots.py - Revert predefined_conventional_loads_by_sector to scale by annual_consumption (p_set scaling was incorrect per supervisor feedback) - Update test_timeseries.py assertions to match annual_consumption scaling
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.
Description
This PR extends
edisgo.tools.plots.plot_plotlyto support custom colors for lines and nodes.What changed
line_colornow accepts, in addition to existing string options, apandas.Seriesordictmapping branch_name → color (e.g.
"red","#ff0000").node_colornow accepts, in addition to existing string options, apandas.Seriesordictmapping bus_name → color.
"loading","relative_loading","reinforce","voltage_deviation","adjacencies") is unchanged.Fixes #385
Type of change
Checklist:
pre-commithooksUsage examples