Deltares / Deltares/MeshKernelPy

global grid from `mesh2d_make_global` does not always extend to the poles

Open
#236 1 comment 0 reactions 0 assignees View on GitHub

@BillSenior is already working on this.

Since Aug 13, 2026.

  • #285 by @BillSenior — open
bug
Dominant language
Python
Stars
27
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Follow-up of https://github.com/Deltares/MeshKernelPy/issues/181. When generating a global grid with "inconvenient" user input
(a low number of latitude values), the resulting grid does not extent to +/- 90 latitude (poles). The code below generates a grid from -/+60 approximately:
image

To Reproduce

from meshkernel import MeshKernel, ProjectionType
import matplotlib.pyplot as plt
plt.close('all')
mk = MeshKernel(projection=ProjectionType.SPHERICAL)
mk.mesh2d_make_global(num_longitude_nodes=100, num_latitude_nodes=20)
mesh2d = mk.mesh2d_get()
fig, ax = plt.subplots()
mesh2d.plot_edges(ax)

Expected behavior
A global grid should always extend from -180 to +180 longitude and -90 to +90 latitude.

Version info (please complete the following information):

  • OS: Windows
  • Version 8.1.2 (build from main on 31 July 2025, including the fix for #181)

Additional context
This is caused by the fact that the requested nx and ny are too far apart. This causes the computed dx/dy in combination with ny to not make it possible to extend to -+90 degrees. In fact, this is because the cells are made square (in meters). I think this is the only valid usecase, so it might then be better to remove the ny from the user input arguments. I believe in interacter it is also being ignored, but it should still be a sensible value. It might be good to improve upon this in meshkernelpy.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the mesh2d_make_global entry point and reproduce the issue with the Python example using 100 longitude nodes and 20 latitude nodes. Verify how the requested node counts determine the grid spacing, then confirm that the resulting global grid reaches -180/+180 longitude and -90/+90 latitude.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.