Skip to content

Swapping PyEphem moon calculations for astropy's - #167

Merged
bmorris3 merged 11 commits into
astropy:masterfrom
bmorris3:remove-pyephem
Jul 27, 2016
Merged

bmorris3 merged 11 commits into
astropy:masterfrom
bmorris3:remove-pyephem

Conversation

@bmorris3

@bmorris3 bmorris3 commented Jun 13, 2016 •

Copy link
Copy Markdown
Contributor

This is the beginning of an attempt to remove astroplan's dependence on PyEphem to calculate the moon's position (#35, #111). I say this is the "beginning" of an attempt because there is an issue with astropy.coordinates.get_moon which doesn't allow non-scalar time inputs (astropy/astropy#5069). I've looped over calls to get_moon with scalar times to produce the expected outputs until fixed. I left TODO notes in the functions where the workaround has been used, and if/when this PR gets merged, I'll post an issue to remind us to fix those methods once astropy/astropy#5069 is fixed.

Also note that this PR will not pass the CI tests until astropy 1.2 is released (with the new solar system ephemerides features). We will need to require that astroplan uses astropy>=1.2.

On my machine, I'm getting an error when testing with --remote-data relating to the IERS downloads, and I can't tell if the error is unique to my machine. The doctests trigger an IERS download which prints a "downloading..." notification to stdout, which results in unexpected output from a line in the docstring example, causing the doctests to fail.

@bmorris3

Copy link
Copy Markdown
Contributor Author

I'll revisit this in a few days, on or after June 15, when astropy 1.2 is released and conda installable, and the tests will function appropriately with the astropy>=1.2 requirement.

@bsipocz

bsipocz commented Jul 27, 2016

Copy link
Copy Markdown
Member

@bmorris3 - You probably get a green travis after a rebase as the remote builds are already been moved to the allow_failures part

@bmorris3

bmorris3 commented Jul 27, 2016 •

Copy link
Copy Markdown
Contributor Author

@bsipocz I already rebased, but I'm still getting some failures. They're coming from the same error we dealt with earlier, that the IERS tables are downloading and producing unexpected outputs in the doctests.

@bsipocz

bsipocz commented Jul 27, 2016

Copy link
Copy Markdown
Member

@bmorris3 - You need to modify .travis.yml under the allow_failure part as it need to have the exact same build as above in the matrix.
Also please note that we didn't really dealt with the IERS issues, just ignored them for now.

@bmorris3

Copy link
Copy Markdown
Contributor Author

Thanks @bsipocz for the enormous effort in making this work!

time = Time('2012-06-21 03:00:00')
location = EarthLocation.from_geodetic(-155*u.deg, 19*u.deg, 0*u.m)

import ephem

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird, why is this passed on travis?

@bmorris3 bmorris3 Jul 28, 2016 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It passes because the tests only run functions that begin with test_* in the name.

These print_pyephem_* functions are used to produce the hard-coded reference values for various calculations used to check astroplan in the tests. Therefore they will stay in the testing code, so that users with PyEphem and double-check/reproduce the reference values if they explicitly run the print_pyephem_* functions directly.

bsipocz pushed a commit to bsipocz/astroplan that referenced this pull request Jul 29, 2016
Swapping PyEphem moon calculations for astropy's
This was referenced Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants