Skip to content

Commit cccfc1a

Browse files
minimized diff
1 parent 1302b75 commit cccfc1a

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

tests/dflowfm/test_net.py

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,6 @@ def test_create_2d():
201201
mesh2d = Mesh2d(meshkernel=MeshKernel())
202202
mesh2d.create_rectilinear(extent=bbox, dx=0.5, dy=0.75)
203203

204-
# TODO: remove plotting
205-
# _, ax = plt.subplots()
206-
# mesh2d_output.plot_edges(ax=ax)
207-
208204
mesh2d_output = mesh2d.get_mesh2d()
209205
assert mesh2d_output.node_x.size == 45
210206
assert mesh2d_output.edge_nodes.size == 152
@@ -237,11 +233,6 @@ def test_create_clip_2d(deletemeshoption, inside, nnodes, nedgenodes, nfaces):
237233
assert mesh2d_output.edge_nodes.size == nedgenodes # 2x nedges
238234
assert mesh2d_output.face_x.size == nfaces
239235

240-
# TODO: remove plotting
241-
# _, ax = plt.subplots()
242-
# mesh2d_output.plot_edges(ax=ax)
243-
# ax.plot(polygon.x_coordinates, polygon.y_coordinates, "r-")
244-
245236

246237
def test_create_refine_2d():
247238

@@ -269,11 +260,6 @@ def test_create_refine_2d():
269260
assert fnc.shape == (100, 4)
270261
assert (fnc == -2147483648).sum() == 12 # amount of triangles
271262

272-
# TODO: remove plotting
273-
# _, ax = plt.subplots()
274-
# mesh2d_output = mesh2d.get_mesh2d()
275-
# mesh2d_output.plot_edges(ax=ax)
276-
277263

278264
cases = [
279265
test_input_dir / "e02/f101_1D-boundaries/c01_steady-state-flow/Boundary_net.nc",
@@ -664,19 +650,18 @@ def test_create_triangular():
664650
)
665651

666652
network.mesh2d_create_triangular_within_polygon(polygon)
667-
mesh2d_output = network._mesh2d.get_mesh2d()
668-
653+
669654
assert np.array_equiv(
670-
mesh2d_output.node_x,
655+
network._mesh2d.mesh2d_node_x,
671656
np.array([6.0, 4.0, 2.0, 0.0]),
672657
)
673658
assert np.array_equiv(
674-
mesh2d_output.node_y,
659+
network._mesh2d.mesh2d_node_y,
675660
np.array([2.0, 7.0, 6.0, 0.0]),
676661
)
677662
assert np.array_equiv(
678-
mesh2d_output.edge_nodes,
679-
np.array([[2, 3], [3, 0], [0, 2], [0, 1], [1, 2]]).ravel(),
663+
network._mesh2d.mesh2d_edge_nodes,
664+
np.array([[2, 3], [3, 0], [0, 2], [0, 1], [1, 2]]),
680665
)
681666

682667

@@ -691,11 +676,11 @@ def test_add_1d2d_links():
691676
# Create Mesh2d
692677
network.mesh2d_create_rectilinear_within_extent(extent=(-5, -5, 5, 5), dx=1, dy=1)
693678

694-
# network._mesh1d._set_mesh1d() #TODO: already set with updated code
695-
# network._mesh2d._set_mesh2d() #TODO: already set with updated code
696-
network._mesh1d.meshkernel.mesh1d_get().node_x
697-
network._mesh2d.meshkernel.mesh2d_get().node_x
698-
679+
m1d_nnodes = network._mesh1d.meshkernel.mesh1d_get().node_x.size
680+
m2d_nnodes = network._mesh2d.meshkernel.mesh2d_get().node_x.size
681+
assert m1d_nnodes == 12
682+
assert m2d_nnodes == 121
683+
699684
# Get required arguments
700685
node_mask = network._mesh1d.get_node_mask([branchid])
701686
exterior = GeometryList(

0 commit comments

Comments
 (0)