From df5b59ae57c7c17fa117d6a6022ad114370ae8eb Mon Sep 17 00:00:00 2001 From: BillSenior Date: Mon, 20 Apr 2026 15:26:55 +0200 Subject: [PATCH 1/3] GRIDEDIT-2223 Added enums for netlink contours and face bounds --- meshkernel/py_structures.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meshkernel/py_structures.py b/meshkernel/py_structures.py index 056f8b88..f40d0e0c 100644 --- a/meshkernel/py_structures.py +++ b/meshkernel/py_structures.py @@ -133,6 +133,8 @@ class Property(IntEnum): ORTHOGONALITY = 0 EDGE_LENGTHS = 1 FACE_CIRCUMCENTER = 2 + NETLINK_CONTOUR_POLYGON = 3 + FACE_BOUNDS = 4 def __init__( self, From 71ae1cac1ec809bc4c79e29b3d9eb85e8e437a28 Mon Sep 17 00:00:00 2001 From: Bill Senior Date: Tue, 21 Apr 2026 13:04:35 +0200 Subject: [PATCH 2/3] GRIDEDIT-2223 Added simple unit test for netlink contour polygons --- tests/test_mesh2d_basics.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/test_mesh2d_basics.py b/tests/test_mesh2d_basics.py index ea48b41d..a9a41d4b 100644 --- a/tests/test_mesh2d_basics.py +++ b/tests/test_mesh2d_basics.py @@ -2460,6 +2460,36 @@ def test_mesh2d_get_circumcentre_property(): assert property_list.y_coordinates == approx(expected_y_coords, abs=1e-6) +def test_mesh2d_get_netlink_countour_polygon_property(): + """Test mesh2d_get property for netlink contour polygons, + getting the mesh2d property values + """ + + make_grid_parameters = MakeGridParameters( + angle=0, + origin_x=0.0, + origin_y=0.0, + upper_right_x=20.0, + upper_right_y=20.0, + block_size_x=10.0, + block_size_y=10.0, + ) + + mk = MeshKernel(projection=ProjectionType.CARTESIAN) + mk.curvilinear_compute_rectangular_grid_on_extension(make_grid_parameters) + mk.curvilinear_convert_to_mesh2d() + + property = Mesh2d.Property.NETLINK_CONTOUR_POLYGON + location = Mesh2dLocation.EDGES + + property_list = mk.mesh2d_get_property(location, property) + + print(property_list.x_coordinates) + print(property_list.y_coordinates) + + assert property_list.x_coordinates.size == 48 + + def test_mesh2d_get_filtered_face_polygons(): """Test mesh2d_get_filtered_face_polygons, getting the polygons of faces with all edges having bad orthogonality values From 2cae5f2d2739b7ecd6c61d0ef411aad816e91a27 Mon Sep 17 00:00:00 2001 From: Bill Senior Date: Tue, 21 Apr 2026 13:22:03 +0200 Subject: [PATCH 3/3] GRIDEDIT-2223 Removed print statement --- tests/test_mesh2d_basics.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/test_mesh2d_basics.py b/tests/test_mesh2d_basics.py index a9a41d4b..645a2c2a 100644 --- a/tests/test_mesh2d_basics.py +++ b/tests/test_mesh2d_basics.py @@ -2484,9 +2484,6 @@ def test_mesh2d_get_netlink_countour_polygon_property(): property_list = mk.mesh2d_get_property(location, property) - print(property_list.x_coordinates) - print(property_list.y_coordinates) - assert property_list.x_coordinates.size == 48