Skip to content

Geopandas backend for valve layer#572

Merged
kbonney merged 5 commits into
USEPA:mainfrom
kbonney:valve-plotting
Jun 30, 2026
Merged

Geopandas backend for valve layer#572
kbonney merged 5 commits into
USEPA:mainfrom
kbonney:valve-plotting

Conversation

@kbonney

@kbonney kbonney commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR continues work started in #451 by adding a GeoPandas backend plotting option for plot_valve_layer. This modernizes another important plotting function while also handling several issues with the function:

  • When using the nx version of plot_valve_layer with the 'gpd' backend for plot_network the valves appear underneath the network (this is caused by a zorder issue).
  • The nx valve layer plotting does not take into account vertices when choosing valve coordinates, which can cause mismatches when using the 'gpd' plot_network.
  • The nx valve layer plotting would cause some unwanted artifacts in some cases.

Comparison plot:
image

Tests and Documentation

Added tests for previously untested plot_valve_layer function.

AI Disclosure

  • No AI tools were used in this contribution
  • I used AI tools in this contribution.

Acknowledgement

By contributing to WNTR, I acknowledge that I have reviewed the software quality assurance guidelines and agree to the following terms and conditions for my contribution:

  1. I agree that my contributions are submitted under the Revised BSD License.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.
  3. If code was generated using AI tools, I have disclosed the use of AI and reviewed all code for quality assurance, correctness, security, and licensing.
  • I have read and agree to the above acknowledgement
image

Tests and Documentation

Added tests for previously untested plot_valve_layer function.

AI Disclosure

  • No AI tools were used in this contribution
  • I used AI tools in this contribution.

Acknowledgement

By contributing to WNTR, I acknowledge that I have reviewed the software quality assurance guidelines and agree to the following terms and conditions for my contribution:

  1. I agree that my contributions are submitted under the Revised BSD License.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.
  3. If code was generated using AI tools, I have disclosed the use of AI and reviewed all code for quality assurance, correctness, security, and licensing.
  • I have read and agree to the above acknowledgement

@kbonney
kbonney merged commit 2fbb513 into USEPA:main Jun 30, 2026
23 checks passed
@kbonney
kbonney deleted the valve-plotting branch July 2, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant