-
-
Notifications
You must be signed in to change notification settings - Fork 2k
str(SkyCoord) should not return repr-style output #3315
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
Conversation
|
Milestoning as 1.0 since I think this will be critical to have if we merge #3011 |
|
I'm good with this, except that I think the default should always be decimal. This provides a consistent and easily-machine parseable output for any situation. For me consistency is the key, and having |
|
I think we had this argument about always decimal vs. frame-dependent style before and I managed to convince people to stick with decimal always as the default repr of coordinate values. |
|
@taldcroft - ok I don't mind if we keep the current This would then allow users to customize the output style used for Table.write if that simply uses In any case, it sounds like you agree that |
|
Yes, I'm totally in favor of having the formatting of I agree that the way we implement this will take some discussion and almost certainly cannot make 1.0. |
|
One slight hiccup with linking |
|
One option is to simply raise an error if |
|
👍 to linking On multiple coordinates: I think one string presented as a list of strings is the best solution. How about just returning p.s. We should try to define default formats consistently through astropy. |
|
One issue I found is also that the default +1 for consistency across Astropy. I like the |
|
I've now changed this to return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be same asstr(SkyCoord.to_string())` (add parentheses at end).
|
@astrofrog - I realise it is slightly beyond the narrow scope of this PR, but I think for p.s. The travis failures are for unicode issues for python2. From a previous exchange I vaguely remember that one should not use |
|
Damn this Python 2 nonsense. How long are we going to have to support that archaic version? 😛 |
|
Hmm, there are three aspects of this that concern me: First, I think the current implementation is problematic in how it deals with units - that is, it doesn't show them at all. For Second, I think it's also an issue to always require decimal degrees. The following example illustrates the problem: This is happening because the ITRS frame defaults to a Cartesian representation, not Spherical, but Third, I'm worried that this now drops all information about what the frame is. As @taldcroft and @astrofrog said, there's precedence in |
|
@eteq - I share some of those concerns. At the end of the day I think what I would like is to make sure that the output from tables looks sensible. The issue with having the frame in the line with the coordinates is that a table would then look like Having said that I think that |
|
@eteq - definitely some nails on the head, there! I do think the automatic conversion to a pair of angles in degrees is really incorrect, given your example. It is also inconsistent with what That said, I'm much less worried about the system: I think it is for the user to know what system they used; again, there is precedence in Overall, I fear that @taldcroft is right, and |
|
p.s. In the table context, I'd hope both system and units could be listed as the "unit". |
|
I've removed the milestone since this is going to require more discussion. And I agree with @mhvk that whatever happens, the latitude should include a sign ;) |
|
|
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 2 years. I plan to close this in a month if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please close this and open an issue instead to revisit in the future. Maintainers may also choose to add If you believe I commented on this issue incorrectly, please report this here. |
|
Closing this in favour of new issue #6617 |
At the moment
str(SkyCoord)returns a repr-style output:On the other hand,
Timereturns a nicely formatted time:I think the second is correct, and
str(c)should return 'nice' output. I would suggest thatstrshould return the same output asc.to_string().Furthermore,
to_stringat the moment could return a better default:For equatorial systems the default really should be
hmsdms:So there are two requests here:
str(SkyCoord)toSkyCoord.to_stringto_stringBoth of these are trivial so I'm happy to implement them if @eteq and @taldcroft agree.
By the way, this will result in more 'normal' output for
SkyCoordin tables following #3011