Repository navigation
Follow-on to 2586 - #2629
Follow-on to 2586#2629
Conversation
There was a problem hiding this comment.
@eteq - At some point I made this change in my version but backed it out, not wanting to annoy you even more with the number of changes. :-)
There was a problem hiding this comment.
hah, well, maybe I just had to convince myself ;)
|
@eteq - haven't had a chance to try this or read the code in detail, but my question about the controversial change is whether all the frames know about reasonable units ( |
|
@eteq @taldcroft I like the idea of not giving the representations any name or unit information as they are just supposed to represent an arbitrary point in 3D space. @taldcroft You can have any representation in any units? We have a Cartesian system in angular units. It should be up to the frame to decide if it is sensible to have the supplied units or not. You could define a default as long as it easily override able. |
|
OK, I checked out the code and to mind there is now inconsistency. The frames that @eteq cares about have been nicely defined to always represent in degrees, but the others he doesn't like (cylindrical, physicsspherical, and user-defined representations) are left out the wind. In the original design In this PR, how can a user defined representation tell all frames what would be nice units for display? What about meeting half-way and having a |
|
I would call |
|
@taldcroft Why is the behaviour you demonstrate so undesirable? You are creating a NoFrame which means it could be representing anything, why is having the output units sterilized important? |
|
And if it isn't obvious, dropping the default names in representations is a good idea, that always made a bit uncomfortable too. |
|
Doesn't icrs do the same? |
|
Answer: yes
|
|
Slightly OT, but the comment from @Cadair got me thinking about our default class name of BTW, then our equatorial systems could, in theory, inherit from Then we could have a |
|
I like your idea about On the All that said, I see that most of the examples here are string representations that are semi-automatic, so that's sort of an output you want control over. So hence the neutral. FYI, @taldcroft - I think the test you refer to for cylindrical is already implicitly in because there's documentation of that behavior - I had to switch something from deg to rad, anyway. |
I fully agree, but I consider the output of a coordinate for human consumption to be an important "end" point. In defining Part (b) is just overall consistency. Through all the API discussions we came to agreement that coordinate RA and Dec values would always be shown to the user in degrees no matter how they are entered. But of course RA and Dec were only specifically called out because those are the most common attributes, but I would say that by extension APE5 implicitly calls for output of all angular quantities in degrees. To say that we will control the units for Spherical and UnitSpherical but not PhysicsSpherical or Cylindrical is giving a special status to the former that isn't consistent with the overall view that all representations are equal. |
|
Alright, since you clearly have a stronger opinion that I, @taldcroft, I'm ok with putting back in This leaves one question that I side-stepped by removing it, though: does |
|
I think that it's not too confusing to have In this scheme, how should we define the built-in frames? My inclination is to use the second example of using recommended units |
|
What is the status of this? Can we wrap it up over the next day or so for 0.4? |
…presentatiounits to representation_component_units
|
This is now rebased on master (which was quite a task, it turns out!). It still needs the change discussed in #2543 and (making 'icrs' default and removing |
|
I think this now accounts for everything planned, and hence is ready to merge if the tests pass. @taldcroft and/or @astrofrog may want to review before merging, though. |
|
This looks good to me! @taldcroft - please review and merge if you are happy with it too. |
|
Excellent, I'll review this later today. |
There was a problem hiding this comment.
Did these two docstring items leak back in via the rebase? (this and time_attr_names below).
|
@eteq - on the topic of I think the Finally I'm worried about the usage in |
There was a problem hiding this comment.
Clip precision for doctest stability.
|
@eteq - I've finished my review. Apart from the comment about |
|
Alright, I think I've addressed everything except for the question about defining the equinox with a string (which I think is fine, but @taldcroft might want to confirm). So I think |
|
Looks good now. Doing |
|
@eteq et al. - with apologies for taking the honor, I just merged this after it passed tests. Looks like coordinates 0.4 is done!! 🎇 👏 |
|
Hooray 👏 !! (fyi, @astrofrog, this is merged now) |
This PR makes a variety of changes (due) to the mutable
representationfeatures introduced in #2586. There are 4 changes that are probably not too controversial (unless @taldcroft has an objection):default_representationandframe_specific_representation_infoare now turned into read-only properties in the metaclass__new__(so now theframe_specific_representation_infois public, @taldcroft)?usage) and some similar other cosmetic changesrepresentation_namestorepresentation_component_namesandrepresentation_unitstorepresentation_component_units. The original names were quite ambiguous (at leastrepresentation_nameswas - the first time I tried to use it I mis-used it because I thought it was the name of the representation...)frame_specific_representation_infois defined. This is something like the spirit of Use descriptors for frame attributes #2626, but is implemented somewhat differently due to the need to be inside a dictionary. See the diff inbuiltin_frames.pyfor exactly how it looks. The most crucial elements this adds is that the frame name and representation name now appear right next to each other - right now I think it's highly error-prone to have only the frame name and not the representation name. (This is actually putting this back in, as a slightly less clear version of this was in prior to Dynamic coordinate preferred representation #2586 )A final change that might be a bit more controversial (for @taldcroft, @Cadair, or @vaticancameos ?):
default_namesanddefault_unitsfrom representations, and puts back in explicitframe_specific_representation_infoeverywhere. I think this is very important. There are plenty of frames where spherical coordinates are not called RA/Dec, and the whole point of APE5 is to cleanly separate representations and frames (and SkyCoord). Addingdefault_namesthat are different from the actual component attributes blurs these lines and I think makes things a lot more confusing.@taldcroft et al., if this is all ok with you, I'll do a more careful look over the docs to ensure there aren't inconsistencies this introduces, but other than that it should be good. It almost certainly will conflict with #2626 though, so that should go in before this.