Fix arcsin lower bound clamp and test data typo#182
Open
knQzx wants to merge 1 commit into52North:mainfrom
Open
Fix arcsin lower bound clamp and test data typo#182knQzx wants to merge 1 commit into52North:mainfrom
knQzx wants to merge 1 commit into52North:mainfrom
Conversation
- Add lower bound clamping (-1) for arcsin argument in get_apparent_wind() to prevent silent NaN from floating-point rounding (fixes 52North#170) - Fix missing comma in test_ship.py that caused implicit string concatenation ('Error' 'OK' -> 'ErrorOK'), producing a 3-element array instead of 4 (fixes 52North#162)
Author
|
In addition, I've signed the CLA and sent it to your email |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found two issues while reading through the code:
get_apparent_wind()only clamps the upper bound of the arcsin argument but not the lower bound. When floating-point rounding pushes it below -1,np.arcsin()silently returns NaN which corrupts the whole route calculation. Added the missing lower bound check symmetrically to the existing upper bound one.(fixes #170)test_ship.pyhas'Error' 'OK'without a comma — Python concatenates them into'ErrorOK', so the array ends up with 3 elements instead of 4. Tests still passed because they compare the same malformed data on both sides.(fixes #162)I also emailed gsoc@52north.org about GSoC 2026 (knqzx0@gmail.com)