Closed marhofmann closed 5 years ago
The create_busbar_collection was only recently added, so it wasn't yet tested with the switch collections. Great job on making it work, thanks a lot!
Yes the solution does look a little clunky, but I would merge it for now and see if it can be refactored at some point. The easiest way to do this would be using the shapely package, but that can be a little tricky to install so it wouldn't be worth it to include this as a requirement....
Description
Busbar representations are a nice feature since it looks quite messy if a certain number of elements are connected to a bus. So i tried to use the new feature in an example. I tried to connect some lines to busbars at different positions on the busbar. I noticed, that the switching positions are not on the line if the ends of the line are not connected to the middle of the busbar even if i set the argument use_line_geodata=True in the function "pandapower.plotting.create_line_switch_collection".
See what happens with the following code
Fix
I fixed this with a new function "onBusbar" in the collections.py. The function returns the intersection of a line with a certain busbar. Additionally i added a call of this funciton in the "pandapower.plotting.create_line_switch_collection" function and i changed an operator in an if-condition. The result looks like this:
I will add a pull request for this Fix.