Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update meshkernel api calls after new release #563

Closed
5 tasks done
veenstrajelmer opened this issue Oct 4, 2023 · 5 comments · Fixed by #621
Closed
5 tasks done

update meshkernel api calls after new release #563

veenstrajelmer opened this issue Oct 4, 2023 · 5 comments · Fixed by #621
Labels

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Oct 4, 2023

  • the new meshkernelpy release will contain changes in API calls, update these. See below comments from Ahmad for details.
  • update minimal meshkernel version
  • renaming of is_geographic to projection in dfm_tools, hydrolib-core, xugrid, hydromt_delft3dfm >> including enforced ProjectionType
  • update/try testbank (test_meshkernel_helpers.py), modelbuilder notebook, modelbuilder example script, creategrid example script, maybe more
  • revert git link for hydrolib-core in pyproject.toml and requirements.txt

PRs:

@ahmad-el-sayed
Copy link

ahmad-el-sayed commented Oct 10, 2023

Renamed method

The following methods have been renamed:

  • mesh2d_make_mesh_from_polygon -> mesh2d_make_triangular_mesh_from_polygon
  • mesh2d_make_mesh_from_samples -> mesh2d_make_triangular_mesh_from_samples
  • curvilinear_make_uniform -> curvilinear_compute_rectangular_grid
  • curvilinear_make_uniform_from_polygon -> curvilinear_compute_rectangular_grid_from_polygon
  • curvilinear_make_uniform_on_extension -> curvilinear_compute_rectangular_grid_on_extension

New methods

  • mesh2d_make_rectangular_mesh
  • mesh2d_make_rectangular_mesh_from_polygon
  • mesh2d_make_rectangular_mesh_on_extension

Similar to mesh2d_make_triangular_mesh_*, the new functions do not require calling curvilinear_convert_to_mesh2d() after using curvilinear_make_rectangular_grid_*.

@ahmad-el-sayed
Copy link

Specification of projection

The constructor MeshKernel is no longer parametrised by an optional boolean (used to be false for Cartesian coordinates, which is the default, and true for spherical). Now it takes an optional enum, ProjectionType, which is can be CARTESIAN, SPHERICAL or SPHERICALACCURATE. Only the first 2 are supported. The 3rd should result in an exception.

@ahmad-el-sayed
Copy link

ahmad-el-sayed commented Oct 11, 2023

The deletion options in mesh2d_delete calls are defined in the enumerator:

class DeleteMeshOption(IntEnum):
    """Option to delete the mesh inside a polygon."""

    """Deletes mesh inside and not intersected """
    INSIDE_NOT_INTERSECTED = 0

    """Deletes mesh inside and intersected """
    INSIDE_AND_INTERSECTED = 1

@ahmad-el-sayed
Copy link

Adapt mesh2d_connect_meshes signature: def mesh2d_connect_meshes(self, mesh2d: Mesh2d, search_fraction: float) -> None. Recommended search_fraction = 0.4 (was the hardcoded default in the back-end).

@ahmad-el-sayed
Copy link

New method: mesh2d_merge_nodes_with_merging_distance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants