Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to package template 1.1.1 #177

Merged
merged 16 commits into from
Jul 26, 2016

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Jun 16, 2016

No description provided.

version = 'dev'

packagename = os.path.basename(os.path.dirname(__file__))
TESTED_VERSIONS[packagename] = version
Copy link
Contributor

Choose a reason for hiding this comment

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

This line seems to be causing a bunch of test failures.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is due to unrelated conda issues (yet another one, these past couple of days are quite messed up), simply a too old astropy is picked up.

So I would wait with this until those things in astropy/ci-helpers#98 are ironed out.

@bsipocz
Copy link
Member Author

bsipocz commented Jun 21, 2016

@bmorris3 - Can you restart this travis, please?

@bmorris3
Copy link
Contributor

bmorris3 commented Jun 21, 2016

@bsipocz: Things that are still failing

  • Sphinx build on py 2.7: ImportError: Numpy version 1.6.0 or later must be installed to use Astropy

@bsipocz
Copy link
Member Author

bsipocz commented Jun 21, 2016

Ouch, OK, I'll put in on the todo.

On 21 June 2016 at 17:00, Brett M. Morris notifications@github.com wrote:

@bsipocz https://github.com/bsipocz: Things that are still failing

Sphinx build on py 2.7: ImportError: Numpy version 1.6.0 or later must be
installed to use Astropy


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#177 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AGeUwrw3iXTF_daPmUjhhEJXLbWgN2bFks5qOAqFgaJpZM4I26_y
.

@bsipocz
Copy link
Member Author

bsipocz commented Jun 21, 2016

OK, this is now rebased, hopefully it will solve the issues.

@bmorris3
Copy link
Contributor

bmorris3 commented Jun 21, 2016

@bsipocz I think the remaining issues are related to an IERS warning for the remote-data tests, which I came across in #167. I'll make a PR to your branch to fix those (remove the tests).

@bsipocz
Copy link
Member Author

bsipocz commented Jun 22, 2016

@bmorris3 - The fail seems to be related to a new conda issue that just popped up now that the previous ones are solved. I'm on it, but have to admit it's not easy to get fixed while trying to focus on dotastro instead ;)

bsipocz and others added 2 commits June 22, 2016 23:18
Skipping doctests that aren't useful, causing warnings on py2.7
@bsipocz
Copy link
Member Author

bsipocz commented Jun 30, 2016

@bmorris3 - I'm not sure what to do with the remaining two failures.
https://travis-ci.org/astropy/astroplan/jobs/141190508#L747

The first one seems totally out of context (is that download triggered somewhere else, but there is a delay with the output?). For the second one I see the warning locally right before the test header is printed out, but still got the failure later. I guess the warnings are set to be raised only once, thus the test can't catch it?

@bmorris3
Copy link
Contributor

I'm not sure what that's all about. I'm hoping to chat with @eteq to track down what the new IERS behavior is in astropy, which may be the culprit.

@eteq
Copy link
Member

eteq commented Jul 7, 2016

Hmm, the first of the second (:confused:) error is not exactly due to the IERS machinery - it's because when the tests are run in a clean environment they have to download the latest IERS. That's fine except that the first time that happens it prints the message about the download. and that's confusing pytest. So we just have to convince pytest not to worry about that (probably by having a fixture that runs at the start of all the tests that just makes sure the latest IERS are in place.)

The test_iers_download error is more confusing: I'm guessing that's because the new IERS machinery now replaces what we had in astroplan, so the warning isn't getting raised (which is good). But @bmorris3 and I should indeed probably chat to figure out how best to deal with that.

@eteq
Copy link
Member

eteq commented Jul 7, 2016

Oh, but I think the first error is a travis issue - I've seen that happen sometimes just because travis is messed up temporarily. I restarted it just to see if it resolves itself now.

@kvyh
Copy link
Contributor

kvyh commented Jul 9, 2016

I was testing what Time.delta_ut1_utc, and once it gets to the end of the IERS_A table it just continues to use the last delta in the table. To fix the second error, we would either need to have it explicitly reference the IERS table during get_IERS_A_or_workaround()and warn when you leave it, or remove the recwarn.pop from the test_iers_download.

@kvyh
Copy link
Contributor

kvyh commented Jul 13, 2016

The first error occurs every time with python setup.py test --remote-data, but I don't know what's causing it or how it could be fixed. @eteq any ideas on how it could be fixed? I've sent a PR to the branch being PR'ed here bsipocz#4 that fixes the second error. The fix is running into an error with python2.7 not recognizing that OldEarthOrientationDataWarning is a warning.

@bsipocz bsipocz mentioned this pull request Jul 14, 2016
@bsipocz
Copy link
Member Author

bsipocz commented Jul 14, 2016

@bmorris3 @eteq - What about putting the remote tests to the allowed failures for now?
This is probably triviality, but the remote tests pass nicely with the lts branch of astropy (1.0.x)

@kvyh
Copy link
Contributor

kvyh commented Jul 14, 2016

I think allowing the remote tests to fail would be the best option unless we can specifically allow the doctest failure that is caused in sun_rise_time, I'm pretty sure my code should work now to fix the test_iers_download (it is acting like it fixed itself overnight).

@bsipocz
Copy link
Member Author

bsipocz commented Jul 14, 2016

Indeed @kvyh! Thanks. I had two open questions regarding the fix, but can merge it asap, too and move the discussion here instead.

fixed _low_precision to throw the warning when off the table
@bsipocz
Copy link
Member Author

bsipocz commented Jul 14, 2016

Something is getting rather awful here. With the fix of @kvyh the second error goes away, but the first error gets even worse when building against the dev version. To start with the behaviour is different locally, with 1.2 it finds IERS_A in the cache, while with dev it goes into the else part

     if IERS_A_in_cache():
         iers.IERS.iers_table = _get_IERS_A_table()
     else:
         Time._get_delta_ut1_utc = _low_precision_utc_to_ut1

The failure with astropy dev:


/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroplan-test-id4b0x7a/lib.macosx-10.10-x86_64-3.4/astroplan/observer.py:678: UnexpectedException
_________________________________________________________________________ [doctest] astroplan.observer.Observer.sun_set_time _________________________________________________________________________
669         Time at next rise/set of ``target``.
670 
671         Parameters
672         ----------
673         time : `~astropy.time.Time` or other (see below)
674             Time of observation. This will be passed in as the first argument to
675             the `~astropy.time.Time` initializer, so it can be anything that
676             `~astropy.time.Time` will accept (including a `~astropy.time.Time`
677             object)
678 
UNEXPECTED EXCEPTION: AttributeError("'module' object has no attribute 'IERS_Auto'",)
Traceback (most recent call last):

  File "/sw/lib/python3.4/doctest.py", line 1318, in __run
    compileflags, 1), test.globs)

  File "<doctest astroplan.observer.Observer.sun_set_time[4]>", line 1, in <module>

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/utils/decorators.py", line 636, in sun_set_time
    func = make_function_with_signature(func, name=name, **wrapped_args)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/units/decorators.py", line 130, in wrapper
    return wrapped_function(*func_args, **func_kwargs)

  File "/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroplan-test-id4b0x7a/lib.macosx-10.10-x86_64-3.4/astroplan/observer.py", line 1148, in sun_set_time
    return self.target_set_time(time, get_sun(time), which, horizon)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/utils/decorators.py", line 636, in target_set_time
    func = make_function_with_signature(func, name=name, **wrapped_args)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/units/decorators.py", line 130, in wrapper
    return wrapped_function(*func_args, **func_kwargs)

  File "/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroplan-test-id4b0x7a/lib.macosx-10.10-x86_64-3.4/astroplan/observer.py", line 964, in target_set_time
    horizon=horizon))

  File "/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroplan-test-id4b0x7a/lib.macosx-10.10-x86_64-3.4/astroplan/observer.py", line 834, in _determine_which_event
    next_event = function(*args('next'))

  File "/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroplan-test-id4b0x7a/lib.macosx-10.10-x86_64-3.4/astroplan/observer.py", line 717, in _calc_riseset
    altaz = self.altaz(times, target)

  File "/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroplan-test-id4b0x7a/lib.macosx-10.10-x86_64-3.4/astroplan/observer.py", line 480, in altaz
    return coordinate.transform_to(altaz_frame)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/sky_coordinate.py", line 398, in transform_to
    new_coord = trans(self.frame, generic_frame)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/transformations.py", line 918, in __call__
    curr_coord = t(curr_coord, curr_toframe)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/transformations.py", line 706, in __call__
    res = self.func(fromcoord, toframe)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/builtin_frames/cirs_observed_transforms.py", line 66, in cirs_to_altaz
    distance = locitrs.separation_3d(cirs_coo)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/baseframe.py", line 1048, in separation_3d
    other_in_self_system = other.transform_to(self)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/baseframe.py", line 780, in transform_to
    return trans(self, new_frame)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/transformations.py", line 918, in __call__
    curr_coord = t(curr_coord, curr_toframe)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/transformations.py", line 706, in __call__
    res = self.func(fromcoord, toframe)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/builtin_frames/intermediate_rotation_transforms.py", line 77, in cirs_to_itrs
    pmat = cirs_to_itrs_mat(itrs_frame.obstime)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/builtin_frames/intermediate_rotation_transforms.py", line 36, in cirs_to_itrs_mat
    era = erfa.era00(*get_jd12(time, 'ut1'))

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/coordinates/builtin_frames/utils.py", line 143, in get_jd12
    newtime = getattr(time, scale)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/time/core.py", line 1149, in __getattr__
    tm._set_scale(attr)

  File "/Users/bsipocz/.virtualenvs/astropy-dev/lib/python3.4/site-packages/astropy-1.2.dev14833-py3.4-macosx-10.10-x86_64.egg/astropy/time/core.py", line 426, in _set_scale
    args.append(get_dt(jd1, jd2))

  File "/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroplan-test-id4b0x7a/lib.macosx-10.10-x86_64-3.4/astroplan/utils.py", line 40, in _low_precision_utc_to_ut1
    if self.mjd*u.day not in iers.IERS_Auto.open()['MJD']:

AttributeError: 'module' object has no attribute 'IERS_Auto'

/private/var/folders/dc/hsm7tqpx2d57n7vb3k1l81xw0000gq/T/astroplan-test-id4b0x7a/lib.macosx-10.10-x86_64-3.4/astroplan/observer.py:678: UnexpectedException

@bsipocz
Copy link
Member Author

bsipocz commented Jul 14, 2016

So it's still not clear why there is a behaviour difference between 1.2 and dev astropy, but adding AttributeError to the exceptions and thus raising a warning is I think an acceptable workaround.

Also using iers.IERS_Auto.open() rather than iers.IERS.open() solves the problem of downloading a newer version of the table right at the beginning, so no more errors for the doctests.

However I would appreciate if someone more familiar with the IERS infrastructure would give the last few commits it a thorough review.

@bsipocz
Copy link
Member Author

bsipocz commented Jul 15, 2016

This is weird, the remote tests now pass locally for py3, but not for py2 while both still fail on travis.
So as a temporary solution I've allowed them to fail on travis, so this can be merged while we figure out the fix for the problems.

Do you want me to rebase and remove the rather experimental last few commits that clearly didn't work as intended?

@bsipocz
Copy link
Member Author

bsipocz commented Jul 24, 2016

@bmorris3 @eteq - This is readyto go.

There are a few workarounds included, but those I think we should live with them until they are fixed either upstream (e.g. astropy/astropy#5194), or independently of this PR in astroplan.

# Workaround until astropy/astropy#5194 is solved
try:
iers_a = IERS_A.open(download_file(IERS_A_URL, cache=True))
except HTTPError:
Copy link
Member Author

Choose a reason for hiding this comment

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

@taldcroft - I though about using IERS_Auto.open() here, but the sake of this example is to show the difference between A and B, etc, and if A is not available this becomes a bit pointless. However with fresh eyes and brain my solution seems even more hacky than yesterday, and inclined to use the astropy machinery.

@bmorris3 @eteq - what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

@bsipocz - I think the intent is that eventually astroplan will switch to the astropy machinery, right @bmorris3 ? So then there's no need for this at all. Basically this IERS stuff was a stand-in until the machinery in astropy got working.

So with that in mind it doesn't really matter that much one way or another I guess. ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, good to know. I'll try to come back to this in the weekend to clean up.

@wtgee
Copy link
Contributor

wtgee commented Jul 25, 2016

Sorry to pester, but if this is passing can we get it merged? Myself and others want to do some work with astroplan but it currently won't install from source or from pip because of the ConfigParser issue, which is a quick fix but has left it broken for a month now. Thanks!

@bsipocz
Copy link
Member Author

bsipocz commented Jul 25, 2016

@wtgee - I don't have commit rights, so we need to wait for @bmorris3 or @eteq, but both of them are traveling as far as I know.

@wtgee
Copy link
Contributor

wtgee commented Jul 26, 2016

@bsipocz Thanks for letting me know. @bmorris3 @eteq Any ideas when this can happen? This is causing all of our travis-ci builds to fail and is very annoying. If it's not going to happen within a day or two then the ConfigParser items should be merged in a separate pull-request without having to wait for resolution on the IERS issues.

@bmorris3
Copy link
Contributor

Sorry for the delay @bsipocz and @wtgee, I'm back in Seattle and ready to push the big green button! Thanks for all of the help @bsipocz

@bmorris3 bmorris3 merged commit 2736494 into astropy:master Jul 26, 2016
@bmorris3 bmorris3 mentioned this pull request Jul 26, 2016
bsipocz pushed a commit to bsipocz/astroplan that referenced this pull request Jul 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants