Repository navigation
Add more ecliptic frames - #8394
Conversation
|
cc @luojing1211 for checking that this would be what can be used in PINT |
|
@mhvk The
|
not critical but these may be factored out to a backportable PR |
|
@luojing1211 in principle the definition is a copy-paste from PINT, so it should be compatible. The obliquity is entered when instantiating the @bsipocz Sure! I arranged the commits to make it easy. |
|
Thanks for the summary and all the work here, @Juanlu001! I haven't had time to dig in detail yet, but a high-level thought to address the code duplication point: what about inserting some abstract classes that provide the common functionality? E.g. an "abstractmeanecliptic" and "abstracttrueecliptic" and then the subclasses just implement the matricies in question or something like that? Or alternatively (although perhaps too confusingly?) the "true" frames can be subclasses of the "mean" frames that add one more rotation? Either of those might be bigger refactors, and I'm ok with the idea of getting this in first more as it is and adding a follow-on issue to reduce the duplication... Also FWIW, I don't really consider "The number of ecliptic frames ends up being quite high" to be a disadvantage. If I've learned nothing else from this, it's that there really are a zillion different ecliptic frames different people care about! |
|
Oh and on the deprecation pathway, I think if we can the goal is to leave the results the same for 3.2 but with deprecation warnings for anyone using that pathway, and then maybe in 4.0 remove those/actually rename everything to the more logically-sensible naming scheme? |
Sounds good, but just to be sure:
OK, I will try to see how far I can go with this!
I'm not super convinced about this second idea though. |
You mean for 3.2, right? yes, that's what I was thinking. But then we'd have That way by 3.2 we achieve correctness for those who use the "right" true ecliptic, but still get backwards compatibility until 4.0. A second option would be to wait until 4.1 to drop the "wrong" |
|
|
|
I propose |
9760a06 to
755f09d
Compare
|
Current status (diff from
|
|
@mhvk I admit I'm a bit lazy to start refactoring the classes, but also we plan to drop three of them in the next release, so perhaps it's worth waiting? |
|
All: I think we need to think a bit more about the names - I'm quite uncomfortable with forcing people who want the correct As a possible suggestion: could we perhaps use the fact that |
|
Oops, maybe that |
An alternative is to treat the current situation as a bug, and say "look, we changed the semantics of Not sure about the |
|
I'm actually quite happy with the "this was a bug, we now corrected it" approach, but @eteq may not be... |
|
@Juanlu001 Thanks for your hard work on this! I'd also be fine with taking the view that this was a bug...but @eteq is definitely more familiar with the ecliptic frames, so I would feel more comfortable with him taking another look at this. Maybe try emailing him directly? |
|
@eteq Sorry for being a pain in the neck 😇 If I'm not mistaken, 3.2 feature freeze is in three weeks from now. Taking into account that the next version will (likely) be 4.0, I'd really love to get this in for 3.2, and having some days to do relaxed reviews (just in case we can avoid a last-minute sprint two days before the crucial date). If you agree to treat the present state as a bug, I will "fix" it in this PR - if not, I'm open to having a telecon so we can try to reach consensus. |
|
Hmm. I see your points @mhvk @Juanlu001 @adrn. My biggest worry here is that I know at least one person (who talked to me but is not active on github) "worked around" this in 3.1, so their code will suddenly be broken again. But you're right it is a bug so it's legit to just treat it that way. How about this plan: we do as @Juanlu001 says in #8394 (comment) and have this PR just fix it. If I (or anyone else) scrapes together the time, we could potentially have a follow-on PR to move it to my deprecation period proposal, or some other way to try to catch the concern I have above. But I agree it's better to get a fix in for 3.2 vs nothing, so this way even if there's not time/energy for that we get the fix it. |
|
Thanks for chiming in @eteq, sounds like a plan! I'll get back to this ASAP |
adrn
left a comment
There was a problem hiding this comment.
Overall looks ok to me (but I did not review the transformation code in any detail). One minor issue is that the new classes don't appear in the documentation - see inline comment.
|
I took it on myself to write a quick test to boost coverage to hit all the new frames (see f2e1f91) and in the process I had to solve the issue @adrn pointed out in the process (beba865). Sounds like the |
|
Thanks @eteq, you were faster than me :) I was looking into adding some numerical tests cases but deadlines are deadlines. |
|
Ah, on second thought, unless I misunderstood your comment, I think you can actually replace the |
|
OK, I added the what's new entry and fixed an ensuing merge conflict. I think this is good to go if @adrn agrees and the tests pass! |
|
I'm thinking in the current state it's best to merge this as it stands without the |
|
OK, that's fine with me, but please make an issue! |
|
All green so I'm merging. Thanks @Juanlu001! |
As a summary for #6508, there are several conflicting requirements with respect to ecliptic frames:
*TrueEcliptic, which is misleading. This needed some fix.*TrueEclipticframes.As a way to put some solution forward, I took the easy route for this pull request and sacrificed the number of classes in favor of everything else. In short:
*MeanEclipticframes that have the correct (mean) transformations (see fourth commit).HeliocentricEclipticIAU76frame with a fixed equinox at J2000 and the IAU 1976/1980 obliquity, for comparison with systems like JPL HORIZONS (inspired by poliastro, see sixth commit).CustomBarycentricEclipticframe with a fixed equinox at J2000 and a custom obliquity, especially for pulsar timing (inspired by PINT, see seventh commit).Two main disadvantages:
Still missing:
HeliocentricEclipticIAU76andCustomBarycentricEcliptic. The*TrueEclipticwould necessarily need some hardcoded values for the tests.I understand that 4.0 will be LTS, so let's think of a roadmap for 3.2 and 4.0 that makes everyone reasonably happy while respecting the expectations in terms of backwards compatibility breakages, correctness, user friendliness and simplicity.
Note: We kept the old idea of adding
*CorrectTrueEclipticin the git history for posterity (see eighth commit).