Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug on GIS IO caused by varying index names #395

Merged
merged 3 commits into from
Jun 13, 2024
Merged

Conversation

kbonney
Copy link
Collaborator

@kbonney kbonney commented Nov 17, 2023

Summary

Below produces a minimal working example of the bug:
from os.path import join
import wntr

wn_path = "io.inp"
wn = wntr.network.WaterNetworkModel(wn_path)
wn_gis = wn.to_gis()
wn_gis.junctions.index.name = "my_index"
wn2 = wntr.network.from_gis(wn_gis)

WNTR currently expects wn_gis dataframes to all have indexes that are all named None. If custom names are present, the creating of the WN fails. This PR provides a small change to the IO code which accounts for the possibility of named indexes.

Tests and documentation

No tests or docs added.

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.

@kbonney
Copy link
Collaborator Author

kbonney commented Apr 15, 2024

Closing in favor of #414

@kbonney kbonney closed this Apr 15, 2024
@kbonney kbonney reopened this Jun 10, 2024
@kbonney
Copy link
Collaborator Author

kbonney commented Jun 10, 2024

Reopening since #414 was closed by user

@kaklise kaklise merged commit 9173b56 into USEPA:main Jun 13, 2024
28 of 40 checks passed
@kbonney kbonney deleted the gis_io branch June 14, 2024 17:53
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.

2 participants