AndrewAnnex / SpiceyPy

SpiceyPy: a Pythonic Wrapper for the SPICE Toolkit.
MIT License
395 stars 84 forks source link

Bug in test_oscelt and test_oscltx #468

Closed fyellin closed 1 year ago

fyellin commented 1 year ago

The functions test_oscelt and test_oscltx both contain the lines:

mass_earth = spice.bodvrd("EARTH", "GM", 1)
... mass_earth[0]...

However spice.bodvrd returns a tuple of (length, array_of_values). So in both cases mass_earth[0] is the integer 1, which is probably not what this test is supposed to do.

At this point oscelt and oscltx are respectively called with the wrong values, and returns the correct result for those wrong values. We then check that the correct wrong values are returned.

These tests need to be re-written to use

_len, mass_earth = spice_bodvrd("EARTH", "GM", 1)

and the correct result for the actual mass of the earth needs to be used.

AndrewAnnex commented 1 year ago

@fyellin thanks for the issue report and confirmed thats a issue, do you want to contribute a pull request with the changes?

fyellin commented 1 year ago

Sure. I'll fix.

AndrewAnnex commented 1 year ago

469 was merged, thanks @fyellin