-
Notifications
You must be signed in to change notification settings - Fork 8
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
Improve subsetting robustness by using triangle
for buffer meshing
#110
Conversation
8b30231
to
0d1eb80
Compare
elm_polys = [] | ||
for elm_type in ELEM_2D_TYPES: | ||
elems = getattr(mesh, elm_type)['index'] | ||
elm_polys.extend( | ||
[Polygon(mesh.vert2['coord'][cell]) for cell in elems] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old polygon from mesh sometimes failed randomly for cases where two separate polygons are touching at multiple forms, forming islands between them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method might be slower and/or more memory hungry (not tested) but it is correct!
The subset and combine functionality has been also tested by @FariborzDaneshvar-NOAA and @yichengt900 as a part of the on demand workflow for storm simulation for storms including Irene 2011, Harvey 2017, Florence 2018, Ian 2022. The only remaining issue to address is #111 |
Need to pin python to
3.11
due to issues with building current version#57d988f (tag: v20220202)
of triangle.The fix is already in the package, but they just need to release it to PyPI .
Update
A new version of
triangle
is not released on PyPI, so no need to pin to pre3.11
python