Conversation
|
|
||
| def find_neighbors(self) -> Iterator[Id]: | ||
| """Find the buses connected to this bus via a line or switch recursively.""" | ||
| from roseau.load_flow.models.lines import Line, Switch | ||
|
|
There was a problem hiding this comment.
I'm wondering if "neighbors" is not a bit confusing. When I first saw this method, I thought it would only give the adjacent buses connected to that bus.
There was a problem hiding this comment.
Right. I was going with get_connnected_buses at first but it suffers from the same ambiguity as find_neighbors in that it could mean buses connected with one line or switch. Do you have a better name? I can also clarify the docstring to say something like Find all buses connected to this bus via one or more lines or switches, stop at transformers.
There was a problem hiding this comment.
I think we've used the term galvanic component for this kind of stuff, but I'm not convinced that it would be understood easily. Between get_connected_buses and find_neighbors, I think I prefer the former as I find it less confusing, but I agree that there is still an ambiguity that has to be clarified in the docstring.
There was a problem hiding this comment.
OK I renamed it to get_connected_buses and clarified that we are talking about "galvanically connected" buses.
Closes #137
ElectricalNetwork.to_graphmethod to get anetworx.Graphobject representing the networkElectricalNetwork.buses_clustersproperty to group buses on the same voltage levels (i.e. connected via lines or switches)Bus.find_neighbors()method to get an iterator of buses connected to this bus via a line or a switchplotextra to install matplotlib. It was misconfigured in pyproject.tomlI initially planned to remove support for Python 3.9 in this release. This will have to wait to the next release as some interested people I met are still using python 3.9 and this release fixes a lot of pandas warnings for them.