-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
IncompatibleArgumentsError
on Moon's observation events
On some dates, `Moon#observation_events` would throw a `IncompatibleArgumentsError`. This was due to the interpolation method. It takes 3 or 5 approximately equidistant values and interpolate a value between them. Because angles are normalized, an angle that would be 365° would be normalized into 5°. While it makes sense in the library, it breaks the suite of numbers when using interpolation. A list that would initially and logically be `[345, 355, 365]` is changed into `[345, 355, 5]`, which makes the interpolation logic wrong. This fixes this issue by denormalizing values for interpolation when it seems it is needed. When we have consecutive values that are suddenly very far from each other, the method will fix them so that the suite stays uniform. To be honest, this seems a bit hacky and I have no way of making sure this actually works fine without adding tons and tons of new examples with different configurations and making sure the results still make sense. But the library is already quite well test-covered and everything is green, so I guess this new method is fine. Fixes #106
- Loading branch information
1 parent
e76815f
commit 0287959
Showing
5 changed files
with
145 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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