Skip to content

Commit

Permalink
adding a vertex check to test_gis_to_wn
Browse files Browse the repository at this point in the history
  • Loading branch information
kbonney committed Nov 2, 2023
1 parent 12f84c1 commit bdea21e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions wntr/tests/test_gis.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def setUpClass(self):
self.results = sim.run_sim()
self.gis_data = self.wn.to_gis()

vertex_inp_file = join(datadir, "io.inp")
self.vertex_wn = self.wntr.network.WaterNetworkModel(vertex_inp_file)
self.vertex_gis_data = self.vertex_wn.to_gis()

polygon_pts = [[(25,80), (65,80), (65,60), (25,60)],
[(25,60), (80,60), (80,30), (25,30)],
[(40,50), (60,65), (60,15), (40,15)]]
Expand Down Expand Up @@ -102,6 +106,11 @@ def test_gis_to_wn(self):
G2 = wn2.to_graph()

assert nx.is_isomorphic(G1, G2)

# test vertices
vertex_wn2 = wntr.network.io.from_gis(self.vertex_gis_data)
for name, link in vertex_wn2.links():
assert link.vertices == self.vertex_wn.get_link(name).vertices

def test_intersect_points_with_polygons(self):

Expand Down

0 comments on commit bdea21e

Please sign in to comment.