Repository navigation
fix SkyCoord.__init__ edge case with list of one skycoord - #5270
Conversation
| # special case of the above logic for edge case where we have a list of one | ||
| # SkyCoord | ||
| if len(scs) == 1: | ||
| allunitsphrepr = isinstance(scs[0].data, UnitSphericalRepresentation) |
There was a problem hiding this comment.
It would seem simpler to just move this to l.1486 (replacing allunitsphrepr = True with this). That would also make the stanza correct for the case of a list where the first coordinate is not on the unit sphere.
|
What about the following further simplification? I can't see a reason to put the |
|
Yes - that is better! |
|
Yes to this version! But still needs a regression test and an entry in |
|
@StuartLittlefair - I've been travelling quite a bit, so may be a bit slow, but remain very interested! If I still don't get to this by next week, do feel free to ping again. |
|
well, tells you the state of my mind if I even reply to the wrong PR. This one I did look at! |
|
It looks like this passes apart from one travis build that didn't complete. Can someone with write permission restart that one case? (@mhvk, @taldcroft) |
|
I restarted the job, fingers crossed. However, this is the second time I restarted a job with this error at the end: |
|
@taldcroft - I fixed that error in ci-helpers a couple of days back, so it shouldn't appear anymore now. Let me know if it still does. |
|
Thanks @StuartLittlefair ! |
Fix SkyCoord.__init__ edge case with list of one skycoord
|
Backported to 1.0.x in e1fd9bc although with a subtle change of a "fake" |
Fix SkyCoord.__init__ edge case with list of one skycoord
Fix SkyCoord.__init__ edge case with list of one skycoord
This PR fixes #5209.
There are two bugs in that PR. One is that initialising a SkyCoord from a list of SkyCoords that have distances will raise an exception. This is fixed in the current master.
The second bug is an edge case where the distance goes missing when initialising a SkyCoord from a list which contains a single SkyCoord, as shown below. This PR fixes that edge case.