Skip to content

Fix arcsin lower bound clamp and test data typo#182

Open
knQzx wants to merge 1 commit into52North:mainfrom
knQzx:fix/arcsin-clamp-and-test-data
Open

Fix arcsin lower bound clamp and test data typo#182
knQzx wants to merge 1 commit into52North:mainfrom
knQzx:fix/arcsin-clamp-and-test-data

Conversation

@knQzx
Copy link
Copy Markdown

@knQzx knQzx commented Mar 24, 2026

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.py has '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)

- 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)
@knQzx
Copy link
Copy Markdown
Author

knQzx commented Mar 24, 2026

In addition, I've signed the CLA and sent it to your email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant