antarctica / PolarRoute

Long-distance maritime polar route planning, taking into account complex changing environmental conditions.
MIT License
15 stars 3 forks source link

Improve handling of NaN values #245

Open hjabbot opened 5 months ago

hjabbot commented 5 months ago

Moving here from project repo #83.

This could go into MeshiPhi, but I personally think that NaN's are perfectly valid in meshes, so anything downstream should handle NaN's gracefully. Issue is NaNs and Infs aren't natively supported by the JSON schema so strictly speaking they shouldn't be in the output of MeshiPhi meshes, but it seems dangerous to equate NaNs to a real value.


NaN values in the mesh shouldn't be allowed to reach the route planner as they will cause errors that may be difficult to debug. Currently NaN values are filtered out within the vessel performance class and all NaN values are set to zero. We should consider whether this is the correct approach in all cases and identify where NaN values might arise and how their propagation could be avoided.

SamuelHall700 commented 2 months ago

Currently, all NaN's in a mesh are set to 0's by the vessel performance modeller.

With the refactoring of the route planner, we plan to remove this from the vessel performance modeller and have them handled more gracefully by the route planner. This work is still ongoing