Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions meshkernel/meshkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,21 +643,18 @@ def mesh2d_delete_hanging_edges(self) -> None:
self.lib.mkernel_mesh2d_delete_hanging_edges, self._meshkernelid
)

def mesh2d_make_global(
self, num_longitude_nodes: int, num_latitude_nodes: int
) -> None:
"""Compute the global mesh with a given number of points along the longitude and latitude directions.
def mesh2d_make_global(self, num_longitude_nodes: int) -> None:
"""Compute the global mesh with a given number of points along the longitude direction.
The points in the latitude direction will continue up to the poles.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend something like this, a bit more complete: "Compute the global mesh with a given number of points along the longitude direction. The number of points in the latitude direction will be automatically calculated, such that the resulting cells are as square as possible and the resulting mesh extends up to the poles."

Besides that: "points" is not terminology I am familiar with, what do you think of using "nodes" or "cells" or do you prefer the current "points"?


Args:
num_longitude_nodes (int): The number of points along the longitude.
num_latitude_nodes (int): The number of points along the latitude (half hemisphere)
"""
Comment thread
BillSenior marked this conversation as resolved.

self._execute_function(
self.lib.mkernel_mesh2d_make_global,
self._meshkernelid,
c_int(num_longitude_nodes),
c_int(num_latitude_nodes),
)

def mesh2d_make_triangular_mesh_from_polygon(
Expand Down
6 changes: 2 additions & 4 deletions tests/test_mesh2d_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,8 @@ def test_mesh2d_make_global():
mk = MeshKernel(ProjectionType.SPHERICAL)

num_longitude_nodes = 19
num_latitude_nodes = 25

mk.mesh2d_make_global(num_longitude_nodes, num_latitude_nodes)
mk.mesh2d_make_global(num_longitude_nodes)
mesh2d = mk.mesh2d_get()

assert mesh2d.edge_x.size == 1225
Expand All @@ -698,10 +697,9 @@ def test_mesh2d_make_global_with_cartesian_coordinates_should_throw():
mk = MeshKernel(ProjectionType.CARTESIAN)

num_longitude_nodes = 19
num_latitude_nodes = 25

with pytest.raises(MeshKernelError):
mk.mesh2d_make_global(num_longitude_nodes, num_latitude_nodes)
mk.mesh2d_make_global(num_longitude_nodes)


def test_mesh2d_make_triangular_mesh_from_polygon():
Expand Down
Loading