Update plot_network to use the geopandas plotting API in place of the networkx plotting API #451
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.
Summary
This PR updates the
plot_network
function by replacingnetworkx
plotting functions withgeopandas
plotting functions. This builds on the geospatial capabilities ofwntr
by using theGeoDataFrames
generated byto_gis()
to interface with thegeopandas
plotting capabilities. This update reduces the complexity of the plotting code, making it easier to maintain and opening opportunities for other plotting options.These updates aim to minimize changes to the output of
plot_network
, except where changes add functionality.The arguments of
plot_network
remain unchanged, with the exception of some additional keyword arguments with defaults, so these updates should be fully backwards compatible.New functionality includes:
link_attribute
andnode_attribute
string options are expanded to include attributes for all assets (pipe, valve, and pump for link and junction, tank, and reservoir for node)Note that relying on
geopandas
for plotting will require elevatinggeopandas
from an optional dependency to a required one.This PR addresses #223 since geopandas plots the vertices, which means #390 is no longer necessary.
Tests and documentation
Current tests and documentation already cover the
plot_network
function.Acknowledgement
By contributing to this software project, I acknowledge that I have reviewed the software quality assurance guidelines and that my contributions are submitted under the Revised BSD License.