Skip to content

GRIDEDIT-2301 Global grid always extends to poles - #285

Open
BillSenior wants to merge 4 commits into
mainfrom
feature/GRIDEDIT-2301_generate_global_grid
Open

GRIDEDIT-2301 Global grid always extends to poles#285
BillSenior wants to merge 4 commits into
mainfrom
feature/GRIDEDIT-2301_generate_global_grid

Conversation

@BillSenior

Copy link
Copy Markdown
Contributor

… call

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the MeshKernelPy API for generating a global 2D mesh so the latitude discretization is no longer caller-provided, aligning with the goal that the global grid extends to the poles by construction.

Changes:

  • Changed MeshKernel.mesh2d_make_global to accept only num_longitude_nodes and removed the latitude-node argument.
  • Updated the corresponding basic tests to call the new one-argument API.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
meshkernel/meshkernel.py Updates the public wrapper method signature and its docstring for global grid generation.
tests/test_mesh2d_basics.py Adjusts unit tests to use the new mesh2d_make_global(num_longitude_nodes) call pattern.
Suppressed comments (1)

tests/test_mesh2d_basics.py:692

  • Given the PR goal (“global grid always extends to poles”), this test only asserts array sizes, which won’t catch regressions where the latitude extent still doesn’t reach ±90°. Add explicit assertions on the latitude range (min/max of node_y) to validate the new behavior.
    mesh2d = mk.mesh2d_get()

    assert mesh2d.edge_x.size == 1225
    assert mesh2d.node_x.size == 621


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread meshkernel/meshkernel.py Outdated
Comment on lines +646 to +648
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 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.

Comment thread meshkernel/meshkernel.py
@BillSenior
BillSenior force-pushed the feature/GRIDEDIT-2301_generate_global_grid branch from 90da444 to 70a9cbd Compare August 18, 2026 07:42

@veenstrajelmer veenstrajelmer left a comment

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.

One textual suggestion

Comment thread meshkernel/meshkernel.py Outdated
Comment on lines +647 to +648
"""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"?

@veenstrajelmer
veenstrajelmer self-requested a review August 18, 2026 09:49

@veenstrajelmer veenstrajelmer left a comment

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 have one textual suggestion. And please also update the example notebook to not include the deprecated argument: https://github.com/Deltares/MeshKernelPy/blob/main/docs/examples/10_mesh2d_global_grid.ipynb

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@veenstrajelmer veenstrajelmer left a comment

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.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

global grid from mesh2d_make_global does not always extend to the poles

3 participants