CHLNDDEV / oceanmesh

Automatic coastal ocean mesh generation in Python and C++. **under development**
GNU General Public License v3.0
55 stars 15 forks source link

Remove nan in nodes for in_poly2 #56

Closed alcoat closed 2 years ago

alcoat commented 2 years ago

with numpy=1.23.0 and inpoly=0.2.0, the nodes can't have nan values when calling in_poly2

krober10nd commented 2 years ago

What changed in numpy that stopped nans working in inpoly I wonder? I can change inpoly too

krober10nd commented 2 years ago

FYI https://github.com/rasterio/rasterio/issues/2333

krober10nd commented 2 years ago

Thank you for putting this together. Unfortunately while the tests do technically pass and do not produce fatal errors, when you visualize some of their outputs, it shows that the change to avoid passing nans to inpoly are creating new issues. This does not happen on the main branch.

More generally, I'd like to figure out why inpoly stops working with Python 3.10.

For example visualizing test_irregular_domain.py or test_multiscale.py

image

alcoat commented 2 years ago

Hi, I found a solution to this issue by removing duplicate points in the shoreline ! I will prepare the fix.

alcoat commented 2 years ago

The new mesh produced with Python 3.10 Figure_1 !

krober10nd commented 2 years ago

Excellent work @alcoat. I ran the tests locally with other versions of Python and things have worked out. So I'm okay with this as is.