Commit feb0ced
authored
Feature/plotting kwargs and streamline data conversion (#439)
* Feature/398 feature facet plots in results (#419)
* Add animation and faceting options to plots
* Adjust size of the frame
* Utilize plotly express directly
* Rmeocve old class
* Use plotly express and modify stackgroup afterwards
* Add modifications also to animations
* Mkae more compact
* Remove height stuff
* Remove line and make set opacity =0 for area
* Integrate faceting and animating into existing with_plotly method
* Improve results.py
* Improve results.py
* Move check if dims are found to plotting.py
* Fix usage of indexer
* Change selection string with indexer
* Change behaviout of parameter "indexing"
* Update CHANGELOG.md
* Add new selection parameter to plotting methods
* deprectae old indexer parameter
* deprectae old indexer parameter
* Add test
* Add test
* Add test
* Add test
* Fix not supportet check for matplotlib
* Typo in CHANGELOG.md
* Feature/398 feature facet plots in results heatmaps (#418)
* Add animation and faceting options to plots
* Adjust size of the frame
* Utilize plotly express directly
* Rmeocve old class
* Use plotly express and modify stackgroup afterwards
* Add modifications also to animations
* Mkae more compact
* Remove height stuff
* Remove line and make set opacity =0 for area
* Integrate faceting and animating into existing with_plotly method
* Improve results.py
* Improve results.py
* Move check if dims are found to plotting.py
* Fix usage of indexer
* Change selection string with indexer
* Change behaviout of parameter "indexing"
* Update CHANGELOG.md
* Add new selection parameter to plotting methods
* deprectae old indexer parameter
* deprectae old indexer parameter
* Add test
* Add test
* Add test
* Add test
* Add heatmap support
* Unify to a single heatmap method per engine
* Change defaults
* readd time reshaping
* readd time reshaping
* lengthen scenario example
* Update
* Improve heatmap plotting
* Improve heatmap plotting
* Moved reshaping to plotting.py
* COmbinations are possible!
* Improve 'auto'behavioour
* Improve 'auto' behavioour
* Improve 'auto' behavioour
* Allow multiple variables in a heatmap
* Update modeule level plot_heatmap()
* remove code duplication
* Allow Dataset instead of List of DataArrays
* Allow Dataset instead of List of DataArrays
* Update plot tests
* FIx Missing renme in ElementResults.plot_heatmap()
* Update API
* Feature/398 feature facet plots in results charge state (#417)
* Add animation and faceting options to plots
* Adjust size of the frame
* Utilize plotly express directly
* Rmeocve old class
* Use plotly express and modify stackgroup afterwards
* Add modifications also to animations
* Mkae more compact
* Remove height stuff
* Remove line and make set opacity =0 for area
* Integrate faceting and animating into existing with_plotly method
* Improve results.py
* Improve results.py
* Move check if dims are found to plotting.py
* Fix usage of indexer
* Change selection string with indexer
* Change behaviout of parameter "indexing"
* Update CHANGELOG.md
* Add new selection parameter to plotting methods
* deprectae old indexer parameter
* deprectae old indexer parameter
* Add test
* Add test
* Add test
* Add test
* Add heatmap support
* Unify to a single heatmap method per engine
* Change defaults
* readd time reshaping
* readd time reshaping
* lengthen scenario example
* Update
* Improve heatmap plotting
* Improve heatmap plotting
* Moved reshaping to plotting.py
* COmbinations are possible!
* Improve 'auto'behavioour
* Improve 'auto' behavioour
* Improve 'auto' behavioour
* Allow multiple variables in a heatmap
* Update modeule level plot_heatmap()
* remove code duplication
* Allow Dataset instead of List of DataArrays
* Allow Dataset instead of List of DataArrays
* Add tests
* More examples
* Update plot_charge state()
* Try 1
* Try 2
* Add more examples
* Add more examples
* Add smooth line for charge state and use "area" as default
* Update scenario_example.py
* Update tests
* Fix Error handling in plot_heatmap()
* Feature/398 feature facet plots in results pie (#421)
* Add animation and faceting options to plots
* Adjust size of the frame
* Utilize plotly express directly
* Rmeocve old class
* Use plotly express and modify stackgroup afterwards
* Add modifications also to animations
* Mkae more compact
* Remove height stuff
* Remove line and make set opacity =0 for area
* Integrate faceting and animating into existing with_plotly method
* Improve results.py
* Improve results.py
* Move check if dims are found to plotting.py
* Fix usage of indexer
* Change selection string with indexer
* Change behaviout of parameter "indexing"
* Update CHANGELOG.md
* Add new selection parameter to plotting methods
* deprectae old indexer parameter
* deprectae old indexer parameter
* Add test
* Add test
* Add test
* Add test
* Add heatmap support
* Unify to a single heatmap method per engine
* Change defaults
* readd time reshaping
* readd time reshaping
* lengthen scenario example
* Update
* Improve heatmap plotting
* Improve heatmap plotting
* Moved reshaping to plotting.py
* COmbinations are possible!
* Improve 'auto'behavioour
* Improve 'auto' behavioour
* Improve 'auto' behavioour
* Allow multiple variables in a heatmap
* Update modeule level plot_heatmap()
* remove code duplication
* Allow Dataset instead of List of DataArrays
* Allow Dataset instead of List of DataArrays
* Add tests
* More examples
* Update plot_charge state()
* Try 1
* Try 2
* Add more examples
* Add more examples
* Add smooth line for charge state and use "area" as default
* Update scenario_example.py
* Update tests
* Handle extra dims in pie plots by selecting the first
* 6. Optimized time-step check
- Replaced pandas Series diff() with NumPy np.diff() for better performance
- Changed check from > 0 to > 1 (can't calculate diff with 0 or 1 element)
- Converted to seconds first, then to minutes to avoid pandas timedelta conversion issues
* Typo
* Improve type handling
* Update other tests
* Handle backwards compatability
* Add better error messages if both new and old api are used
* Add old api explicitly
* Add old api explicitly
* Improve consistency and properly deprectae the indexer parameter
* Remove amount of new tests
* Remove amount of new tests
* Fix CONTRIBUTING.md
* Remove old test file
* Add tests/test_heatmap_reshape.py
* Add tests/test_heatmap_reshape.py
* Remove unused method
* - Implemented dashed line styling for "mixed" variables (variables with both positive and negative values)
- Only stack "positive" and "negative" classifications, not "mixed" or "zero"
* - Added fill parameter to module-level plot_heatmap function (line 1914)
- Added fill parameter to CalculationResults.plot_heatmap method (line 702)
- Forwarded fill parameter to both heatmap_with_plotly and heatmap_with_matplotlib functions
* - Added np.random.seed(42) for reproducible test results
- Added specific size assertions to all tests:
- Daily/hourly pattern: 3 days × 24 hours
- Weekly/daily pattern: 1 week × 7 days
- Irregular data: 25 hours × 60 minutes
- Multidimensional: 2 days × 24 hours with preserved scenario dimension
* Improve Error Message if too many dims for matplotlib
* Improve Error Message if too many dims for matplotlib
* Improve Error Message if too many dims for matplotlib
* Rename _apply_indexer_to_data() to _apply_selection_to_data()
* Bugfix
* Update CHANGELOG.md
* Catch edge case in with_plotly()
* Add strict=True
* Improve scenario_example.py
* Improve scenario_example.py
* Change logging level in essage about time reshape
* Update CHANGELOG.md
* Add XarrayColorMapper
* Add XarrayColorMapper to CalculationResults
* Renamed variable
* Add test file
* Improve integration of the ColorMapper
* Improve integration of the ColorMapper
* Update resolve_colors and move to plotting.py
* Temporalily add example script to show/document intended usage
* Add method create_color_mapper
* Improve docstring
* Remove example file again
* Update CHANGELOG.md
* Add create_color_mapper to SegmentedResults
* Add create_color_mapper to complex_example
* Missed some renames
* Fix warning in plot_charge_state()
* Allow for discrete color assignments with rules
* Remove some half baked validation
* Add more color families
* Use 1:7 colors for more distinct colors
* Add color mapper to complex example
* Update CHANGELOG.md
* Convert numpy style docstrings to google style
* Use re.search instead of re.match
* Update tests
* Applying ordering to Dataset as well
* This approach:
- Prevents silent data loss when values like 1, 1.0, and "1" collide
- Provides actionable error messages showing exactly which values are problematic
- Allows users to fix their data rather than hiding the issue
* Improve Error Message
* Enable sorting fpr Datasets
* completed the integration of XarrayColorMapper into both with_plotly and with_matplotlib
* simplified with_matplotlib significantly
* Update plotting methods to focus on xr.DataArray only
* Remove duplication
* Remove duplication
* Make check faster
* Make check faster
* Make check faster
* Fixx plotting issues
* Switch back to Dataset first
* Remove redundant code
* XarrayColorMapper is now Dataset-only!
* Update tests accordingly
* Fix issue in aggregation.py with new plotting
* Fix issue plotting in examples (using dataframes)
* Fix issue plotting in examples (using dataframes)
* Fix issue plotting scalar Datasets
* Improve labeling of plots
* Improve handling of time reshape in plots
* Update usage of plotting methods
* Update pie plots to use Dataset instead of DataFrame
* Makde charge state line in plots black always
* Improve examples
* Make plotting methods much more flexible
* Add test
* Add plotting kwargs to plotting functions
* add imshow kwargs
* Fix nans in plots
* Replace XarrayColorMapper with ComponentColorManager
* Add repr and str method
* Added tests
* Add caching to ColorManager
* Test caching
* Change default colormap and improve colormap settings
* Automatically initiallize the ColorManager
* Use Dark24 as the default colormap
* Rename auto_group_components() to apply_colors()
* Use ColorManager in examples
* Fix tests
* Extend config to cover plotting settings
* Centralize behaviour
* More config options
* More config options
* More config options
* Rename config parameter
* Improve color defaults
* Removed 'auto' and Simplified Color Resolution
* Fix ColorProcessor to accept qualitative colorscales
* Fix ColorProcessor to accept qualitative colorscales
* Remove old test
* Simplified tests
* Update examples and CHANGELOG.md
* Update method name
* Update examples
* extended ComponentColorManager to support flow-level color distinctio
* Change default flow shading
* Improve Setup_colors
* Use external dependency for color handling
* Make colour dependency optional
* streamlined the ColorManager configuration API
* streamlined the ColorManager configuration API
* Update usages of new api
* Update CHANGELOG.md
* Update examples
* use turbo as the new default sequential colormap
* Add support for direct mappings of components
* Add support for direct mappings of components
* Add configurable flow_variation
* Update tests
* Make color getter mroe robust
* Make color getter mroe robust
* Temp
* Update default colormap
* Update default colormap to default colorscale
* Update default Improve colorscale handling
* Update default color families
* Update plotly template
* Update example
* Simplify test
* Update color family defaults
* Simplify documentation
* Typo
* Make matplotlib backend switch more robst
* Update setup_colors() in SegmentedCalculationResults
* Fix example
* Update CHANGELOG.md
* Simplify export_figure()
* Update Examples and CHANGELOG.md
* Simplified Config
* Simplified Colormanagement
* Simplified Colormanagement
* Simplified Colormanagement
* Add element name itself to color dict
* Fix examples
* Bugfix
* Bugfix
* Remove coloring related stuff
* Reverse color and CONFIG related changes in plotting.py
* Reverse color and CONFIG related changes in plotting.py
* Reverse color and CONFIG related changes in plotting.py
* Reverse color and CONFIG related changes in plotting.py
* Reverse color and CONFIG related changes in plotting.py
* Update CHANGELOG.md
* Update CHANGELOG.md
* Remove duplicate resolve color calls
* Improve pie plot
* Simplify pie plot
* Simplify pie plot
* Bugfix
* Bugfix
* Bugfix
* Bugfix
* Bugfix
* Add Series Support for plotting
* Simplify pie plots to be Series First to remove unnessesary data transformations
* Update Typehints
* Test datatypes
* Test datatypes and plotting modes
* Test datatypes and plotting modes
* Test datatypes and plotting modes
* Test datatypes and plotting modes
* Update CHANGELOG.md
* Potential Bugfix
* Fix: plotly kwargs usage
* Update docstrings and fix usage of kwargs
* Improve error handling
* Remove trace and layout kwargs
* Prevent potential bugs in plotting.py
* Improve tests1 parent 4305ed2 commit feb0ced
7 files changed
Lines changed: 899 additions & 564 deletions
File tree
- examples
- 02_Complex
- 03_Calculation_types
- flixopt
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
212 | | - | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| 217 | + | |
216 | 218 | | |
217 | 219 | | |
218 | 220 | | |
219 | | - | |
| 221 | + | |
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
| 225 | + | |
223 | 226 | | |
224 | 227 | | |
225 | 228 | | |
226 | | - | |
| 229 | + | |
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
233 | | - | |
| 236 | + | |
234 | 237 | | |
235 | 238 | | |
236 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
157 | 159 | | |
158 | 160 | | |
159 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| |||
0 commit comments