Correct `NETLINK_CONTOUR_POLYGON`
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start by reproducing the reported behavior with the three mesh examples and inspect the mesh2d_get_property path for Mesh2dProperty.NETLINK_CONTOUR_POLYGON. Compare the returned contour coordinates before and after mesh2d_delete_hanging_edges(), especially the -999 values on the grid with a hanging edge. Done means the property returns a sensible contour for the reported grids.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
The property NETLINK_CONTOUR_POLYGON seems to me incorrect. This was discovered in https://github.com/Deltares/BaselineTools/issues/96, but it happens for more grids.
To Reproduce
Code snippet with several examples:
import xugrid as xu
from meshkernel.py_structures import Mesh2dProperty, Mesh2dLocation
import matplotlib.pyplot as plt
plt.close('all')
import numpy as np
from meshkernel import (
MeshKernel,
ProjectionType,
GeometryList,
MakeGridParameters,
Mesh2dProperty,
Mesh2dLocation,
)
# create basegrid
lon_min, lon_max, lat_min, lat_max = 1, 2, 48.5, 49.2
dxy = 0.7
make_grid_parameters = MakeGridParameters(
origin_x=lon_min,
origin_y=lat_min,
upper_right_x=lon_max,
upper_right_y=lat_max,
block_size_x=dxy,
block_size_y=dxy,
)
mk1 = MeshKernel(projection=ProjectionType.SPHERICAL)
mk1.curvilinear_compute_rectangular_grid_on_extension(make_grid_parameters)
mk1.curvilinear_convert_to_mesh2d() #convert to ugrid/mesh2d
uds2 = xu.open_dataset(r"c:\DATA\checkouts\dfm_tools\docs\notebooks\Vietnam_2D_model\Vietnam_net.nc")
uds3 = xu.open_dataset(r"c:\Users\veenstra\Downloads\zee_middengebied_small_net.nc")
# uds.grid.plot()
# plt.show()
mk2 = uds2.grid.meshkernel
mk3 = uds3.grid.meshkernel
for mk in [mk1, mk2, mk3]:
mesh_orig = mk.mesh2d_get()
# repair the grid with mesh2d_delete_hanging_edges()
hanging_edges = mk.mesh2d_get_hanging_edges()
print(hanging_edges)
mk.mesh2d_delete_hanging_edges()
mesh_fixed = mk.mesh2d_get()
net_contour = mk.mesh2d_get_property(
mesh2d_location=Mesh2dLocation.EDGES,
property=Mesh2dProperty.NETLINK_CONTOUR_POLYGON,
)
fig,(ax1,ax2,ax3) = plt.subplots(1, 3, figsize=(12,5), sharex=True, sharey=True)
mesh_orig.plot_edges(ax=ax1)
mesh_fixed.plot_edges(ax=ax2)
ax3.plot(net_contour.x_coordinates, net_contour.y_coordinates, "r")
fig.tight_layout()
plt.show()
For simple base grid:
For Vietnam model:
For zee_middengebied_small_net:
Expected behavior
This should return NETLINK_CONTOUR_POLYGON that makes sense (and no -999 values for zee rooster that had a hanging edge).
Version info (please complete the following information):
- OS: Windows
- Version 8.4.0
- Lenguaje dominante
- Python
- Estrellas
- 30
- Forks
- 5
- Merge medio
- 1 d 17 h
- PR fusionados (30 d)
- 4
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Deltares/MeshKernelPy
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Deltares/MeshKernelPy#296 ·
-
Add `connect_hanging_nodes` APIAbiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Deltares/MeshKernelPy#287 ·
-
chore
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Deltares/MeshKernelPy#284 ·
-
Add support for Python 3.14Posiblemente ocupada @veenstrajelmer la tomó hace 201 días. Abiertochore
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Deltares/MeshKernelPy#251 · 2 comentarios ·
-
Future proofing packageAbiertochore
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Deltares/MeshKernelPy#190 ·
Todos los issues de Deltares/MeshKernelPy
Issues similares
-
docs(contributing): the two things that silently block a PRPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoavailable documentation good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 95/100
Nixitov/Riptide-Native#944 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
JTHCode/secretguard#24 ·
Los mantenedores suelen responder en 1 día
-
area: middleware documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
omarelshamy25x/shamy-hijri#63 ·
Los mantenedores suelen responder en 1 día