Repository navigation
Fix broadcasting by using vector SkyCoords internally [WIP] - #285
Conversation
|
@bsipocz Can you take a look at this PR? I've so many other issues with my local build (the remote test issues etc) that I can't test it properly, but it may address the broadcasting issues. Is there an easy way to make a local copy of a branch with all the prior fixes so I can test thoroughly? I'm a bit git-challenged! @bmorris3 - this is a really big change to the code, so you probably want to take a look as well. |
|
@StuartLittlefair - Sure, I've merged this into the testing branch, test are running here: https://travis-ci.org/bsipocz/astroplan/builds/197593459 |
|
The docstring issues seems real, what do you think? https://travis-ci.org/bsipocz/astroplan/jobs/197593463#L759 |
|
Ohh, and I forgot to answer the question: usually for testing multiple PRs, I usually open a new separate test branch and merge in the PRs there. If you have travis turned on your fork, this would do the tests there. |
|
I think the failures are real. There's something that needs discussion here - in previous versions of astroplan if you called altaz with M targets and N times (M /= N), you would get an (M, N) array back. Also, if you called altaz with a list of times and single target you'd get a (1, N) array. My PR has changed that behaviour, which has caused some failures in the constraints and scheduling code. I could re-instate it so that altaz worked as before but I would argue the way it works in this PR is an improvement, and it's better the fix the scheduling and constraints code to work with the new behaviour. This does cause the issue that some existing user code might break, but there is still a healthy API warning on the astroplan main page... This is not the current default behaviour |
|
|
||
| coo = get_skycoord(m31) | ||
| assert coo.is_equivalent_frame(ICRS()) | ||
| assert_raises(TypeError, len, coo) |
There was a problem hiding this comment.
Could you please use pytest.raises instead? We don't have nose as a mandatory requirement but pytest, and this currently fails with ImportError: Need nose >= 1.0.0 for tests - see http://somethingaboutorange.com/mrl/projects/nose
|
@bsipocz given the currently broken state of astroplan with astropy 1.3, what do you think about making this PR keep the original behaviour, and submit another PR later for the API change? |
|
Sounds like a good approach to me. |
|
OK - so the version pushed now restores the original behaviour of astroplan, at least as far as it comes to passing the tests. There may be some cases I've not reverted properly - e.g A local test branch with #281, #279, #273 and this PR applied seem to pass tests, with the exception of one failure in scheduler which is (I think) unrelated. |
|
Testing this with travis now here: https://travis-ci.org/bsipocz/astroplan/builds/197668370 |
|
There are still failures, one is the usage of nose (see inline comment), the other one is unrelated and I can fix in another PR. |
|
thanks @bsipocz - fixed the nose issue. |
|
@StuartLittlefair - Thanks a lot, quite good to see that everything is back to normal. pinging @olebole and @ViviCoder as they may want to use this to patch the debian version |
|
@StuartLittlefair Unfortunately there's a little rebase that needs to occur after an update to some |
37c3ff7 to
e178a49
Compare
|
@bmorris3 It might be nice to make astroplan work with the latest version of astropy. I've got two PRs which do that in principle, this and #286. Both only work with astropy v1.3, but #286 could break some user-facing code. #286 is nearly passing tests - just some docstring issues I can't work out. OTOH, this PR doesn't include the PRs mentioned in the thread above, so will never pass tests. Those PRs also can't be merged, since they don't pass tests! I'd appreciate some advice on the next step. Is it a good idea to merge in the changes in #281, #279, #273 and get this PR passing? |
|
@StuartLittlefair @bmorris3 - I think we are already at a point when we need to merge all the bugfix PRs without any of the individual ones passing all the tests. There were already a few tests branches that included all those PRs, if you like I can rerun the tests on the latest one to see whether there are any new divergences compared to astropy dev. |
|
@bsipocz - I think that would be really helpful. |
|
OK, so I've rebased the test branch, and merge this on in, tests are here: We have the a |
|
@bsipocz so I've worked out how to make a test branch on my own repository :) With the latest commits I think I've got all the failures except some of the sphinx warnings. In particular I'm not sure what to do about the Can you merge my latest commits to my test branch and see if you agree with the summary above. Also, any idea what to do about the |
|
@StuartLittlefair - Latest commits from here or from #286? We had the |
|
@bsipocz do my eyes deceive me or is this a passing branch? What's the next step? Presumably one PR based on all the commits that make up your test branch? |
|
Wow, I haven't noticed, copied the link here while it was still running. |
|
Thanks to the hard work of @bsipocz we now have a collection of PRs (this one included) which in combination give a passing test suite! Note that contrary to what is said in the initial message with this PR, it does not change the API. The question is whether you would like multiple small PRs to be merged, or to review on huge PR. In the latter case @bsipocz can create that from her passing branch (see test results above). |
6debb12 to
90f33bf
Compare
|
That should be working and use pip install this case when an astropy
version is not available. I'll look at it after I get home tonight
…On Feb 18, 2017 2:47 PM, "StuartLittlefair" ***@***.***> wrote:
@eteq <https://github.com/eteq> @bsipocz <https://github.com/bsipocz> one
issue remaining building the docs which seems to be that astropy=1.3 is not
available for numpy 1.12 on conda. is it ok to change travis.yml to use
numpy 1.11 for that build or should this be fixed elsewhere?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#285 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGeUwivywyiwLDgjsVzE8bSVWR3W_ospks5rdwSVgaJpZM4L06KH>
.
|
|
OK, so the problem there is that there is no wcsaxes build for np 1.12. In the meantime I'll open another PR that changes to use wcsaxes from astropy when possible rather than the standalone version. |
…ring astropy 1.3 everywhere
|
At the end wcsaxes isn't directly used so it made sense to open a PR against this one. |
Use wcsaxes from astropy
|
Thanks for the PR @bsipocz In the end it hasn't helped - we now have a similar problem with astro query. |
|
@StuartLittlefair - this is indeed an annoying issue. To have a quick and dirty fix, I suggest to add |
this is a temporary fudge until astropy-helpers can be updated
|
@StuartLittlefair Thanks for all of your hard work on this one! |
As described in #215, I think there's an argument for all internal calculations converting their arguments to
TimeandSkyCoordobjects, which may be vector. This PR builds on the utility function in #215 and implements this functionality. It's a large change in theobservercodebase, but outward facing functionality should be compatible with how it was before. However, there are so many unassociated test failures from other issues with astropy 1.3 it's hard to know, hence the WIP designation.Once complete, this PR could fix remaining broadcasting issues with astropy 1.3 (e.g #282, #263, #272).
Some notes:
Although behaviour for scalar times and targets is unchanged, there is an improvement (IMO) in functionality for multiple times and targets. I briefly describe that here.This PR should give identical behaviour to the existing astroplan code, though the internals of the
observermodule have changed quite a lot. Please disregard the code samples below - I've left them in the comment for historical purposesFirst - for scalar objects:
However, if the times and targets are 1D and broadcastable, altaz and similar calcs will broadcast automatically:
also works with lists of
FixedTargetsSo far the same. But using vector skycoords internally adds functionality, since the
horizonargument to theobserverroutines can be non-scalar and it will work as long as you can broadcast the horizon and altaz results:Also, by manipulating the shape of the times and targets object you can create a grid of
altazat all times and targets, rather than broadcasting, e.g:Although I haven't timed the performance I suspect it will be faster than the old, non-vectorised code as well.
There are still some issues with using vector
TimesorSkyCoordswith higher dimensionality - see TODO note in_horiz_cross.