Skip to content

import astroplan should not access the internet #15

Closed

Description

@cdeil

Over in gammapy/gammapy#286 I noticed this error:
https://travis-ci.org/gammapy/gammapy/jobs/68675797#L1092

The reason is that importing astroplan downloads a file:

In [2]: import astroplan
Downloading http://maia.usno.navy.mil/ser7/finals2000A.all
|============================================================================================| 2.9M/2.9M (100.00%)        16s

And because of https://github.com/gammapy/gammapy/blob/master/gammapy/conftest.py#L35 we import astroplan from the Gammapy tests to print it's version number. (We don't use astroplan yet, but we will in the future, so I had already added it).

@eteq @bmorris3 I think the fact that astroplan downloads the IERS table in import is a temp solution anyways. Is there any way to set this up better for now? (if no, no worries, we'll just uncomment that line in Gammapy).

Activity

  1. added this to the 0.1 release milestone on Jun 28, 2015
  2. bmorris3 commented on Jun 28, 2015

    @bmorris3
    Contributor

    I think the fact that astroplan downloads the IERS table in import is a temp solution anyways. Is there any way to set this up better for now?

    That's correct, it's a temporary solution to force astropy to always use the most up-to-date IERS table. The future solution will only download the newer table when recent dates are queried and the most recently downloaded IERS A table is out of date.

    Since it might take some time to sort out the astropy.time adjustments necessary to accommodate that goal, and since this temporary solution simulates what we want the corrected version of astropy to do, I've moved ahead on developing astroplan (See #14 ).

  3. modified the milestones: 0.2 release, 0.1 release on Jul 11, 2015
  4. cdeil commented on Aug 21, 2015

    @cdeil
    MemberAuthor

    As pointed out in #42 (comment), this issue currently makes all tests on travis-ci fail and prevent progress on other PRs.

    I think it's really important to

    • make this optional, i.e. import astroplan should always work without internet access
    • give a better error message

    @bmorris3 or @eteq – Do you have a proposal or PR for a solution to this issue?

  5. bmorris3 commented on Aug 21, 2015

    @bmorris3
    Contributor

    I would like to ask @eteq again if it would be reasonable to include the IERS Bulletin A in astroplan. From the Bulletin A available versions page, it looks like the table is updated once a week but I can't imagine that the precision gained from such frequent updates are truly necessary for the average user.

    We could include a recent version of the bulletin with the install and raise a warning when the cached table is more than a week old and the internet cannot be accessed to grab the latest bulletin. For users who can't access the internet, the best you can do is use the most recent copy from the last time you were connected to the internet. And if you're never connected to the internet apart from the time when you downloaded astroplan, the best you can do is get a table contemporary with your version of the astroplan repo.

  6. bmorris3 commented on Aug 21, 2015

    @bmorris3
    Contributor

    Of course, the above suggestion would work best if there were a web hook or similar service that updated the table file every time we pushed/merged an update to astroplan. @adrn / @cdeil / @eteq Does a service like that exist, or am I dreaming in gitopia?

  7. cdeil commented on Aug 21, 2015

    @cdeil
    MemberAuthor

    That's a 4 MB file?
    If so (or smaller), I think it's OK to bundle a version if it resolves this issue.

    Is it needed for a lot of functionality?
    If no, another solution (which is probably less controversial) is to make it optional, i.e. make import astroplan and python setup.py test run even if the file is not available (skipping the parts that need that file).

  8. cdeil commented on Aug 24, 2015

    @cdeil
    MemberAuthor

    It looks like travis-ci builds for astroplan are passing again (see #68 and https://travis-ci.org/astroplanners/astroplan/builds/77018060) without any changes on our side.

    So this issue with downloading the IERS table on first import was temporary and must have been due to availability issues of the download site or travis-ci.
    I'll re-start the builds on the open PRs that had this fail now ...

    😅

  9. modified the milestones: 0.1 release, 0.2 release on Aug 28, 2015
  10. cdeil commented on Aug 28, 2015

    @cdeil
    MemberAuthor

    This issue has been resolved in #71 ... closing now.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions