Skip to content

Commit c33d14c

Browse files
authored
Merge pull request #347 from ie3-institute/df/#346-duplication
Removed duplicated code within `plots.grid`
2 parents 05b610d + 112e6d2 commit c33d14c

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
1010
### Changed
1111

1212
### Removed
13+
- Removed duplicated code within `plots.grid` [#346](https://github.com/ie3-institute/pypsdm/issues/346)
1314

1415
### Fixed
1516
- Removed `q_characteristics` from `create_energy_management_systems_data` [#326](https://github.com/ie3-institute/pypsdm/issues/326)

pypsdm/plots/grid.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,7 @@ def _node_trace(data, color):
191191

192192
if highlights is not None:
193193
if isinstance(highlights, dict):
194-
rmd = []
195-
for nodes in highlights.values():
196-
rmd.extend(nodes)
197-
rmd = nodes_data.drop(rmd)
198-
_node_trace(rmd, BLUE)
199-
200-
# plot highlighted nodes second so they are on top
194+
# plot not highlighted nodes first
201195
rmd = []
202196
for nodes in highlights.values():
203197
rmd.extend(nodes)
@@ -209,10 +203,7 @@ def _node_trace(data, color):
209203
highlighted_nodes = nodes_data.loc[nodes]
210204
_node_trace(highlighted_nodes, color)
211205
elif isinstance(highlights, list):
212-
rmd = nodes_data.drop(highlights)
213-
_node_trace(rmd, BLUE)
214-
215-
# plot highlighted nodes second so they are on top
206+
# plot not highlighted nodes first
216207
rmd = nodes_data.drop(highlights)
217208
_node_trace(rmd, BLUE)
218209

0 commit comments

Comments
 (0)