API: reintroduce private classes from astropy.visualization.lupton_rgb that were removed without deprecation in astropy 7.0.0#17531
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
|
👋 Thank you for your draft pull request! Do you know that you can use |
25f4f4d to
3a5a2b8
Compare
| were dropped without deprecation in astropy 7.0.0, were re-introduced following | ||
| a report that they were used downstream. | ||
| ``Mapping``, ``AsinhMapping``, ``LinearMapping``, ``AsinhZScaleMapping`` | ||
| use at your own risks |
There was a problem hiding this comment.
This is a placeholder sentence that I'd like to revise with the following information once we've converged upon reviews:
- are these classes tested and/or documented (probably not) ?
- are they actually deprecated, pending deprecation, or none of the above ?
There was a problem hiding this comment.
- If you check out v6.1.x branch and grep for the names, it would probably tell you about test/doc situation. The API doc might be found (or not) at https://docs.astropy.org/en/v6.1.x/ .
- Looks like we can go ahead with deprecation according to comments from @astrofrog and @timj .
There was a problem hiding this comment.
Actually I went the other way and declared them as public, following @saimn (and my) sentiment that there is no reason to disrupt users without a proper alternative.
|
Re: Deprecation -- If we want to be pedantic, it has to be "pending" until 8.0.0 now. But given that they were completely removed in 7.0.0, showing back up in 7.0.1 but deprecated (for real) is still a step forward, so it is up for discussion... 🤷♀️ Maybe @saimn can chime in here as release manager for 7.0.0. |
|
@neutrinoceros --- (1) Re recommended alternatives: (Happy to write an example implementation of a (2) Re testing and documentation for astropy/astropy/visualization/tests/test_lupton_rgb.py Lines 122 to 171 in 5692198 astropy/astropy/visualization/tests/test_lupton_rgb.py Lines 205 to 220 in 5692198 --- these test methods would mostly need to renamed if added to test_lupton_rgb.py, or could be introduced as a separate file test_lupton_rgb_depr_private_classes.pywith tests directly copied from v6.1 (https://github.com/astropy/astropy/blob/v6.1.x/astropy/visualization/tests/test_lupton_rgb.py) (The only documentation for these methods I saw was in the methods' docstrings.) |
|
Re: deprecations - these classes should have been deprecated in 7.0.0 so I think in this case it is acceptable to add the deprecation in 7.0.1. |
|
Is there an alternative to these classes ? If they provided a feature that is used and has no clear alternative, why deprecate those ? |
astropy.visualization.lupton_rgb that were removed without deprecation in astropy 7.0.0
|
If we opt to not deprecated them, maybe we should at least expose them as clearly public somewhere. |
|
Quick comment that Rubin is using AsinhMapping in multiple places (it was code we contributed to astropy). We would have preferred they not be deprecated at all but giving us a chance to work out how to work around the removal would be much appreciated. |
|
Since deprecation will be disruptive for a whole observatory, should we include |
|
If we do not offer an alternative then deprecation (pending or not) would only delay the point of disruption, wouldn't it ?
@timj would it be acceptable for you to move these classes to an isolated package and add it as a dependency where needed ? this seems like the only way to go if we're deprecating. If that is not practical, I'm thinking we should probably embrace these classes as public instead of deprecating them ? |
|
For whatever it's worth (and I don't really know the full context here), I (as a member of the Rubin team) would love them not to disappear at all - asinh and asinh+zscale are both useful to us in several places. |
|
@astrofrog , can we keep both forever? |
|
We have been discussing this internally in Rubin. We realize that we should have been more explicit about what we felt was public API vs internal API. For now we are pinning to <6 but we think that if you merge this PR and have the classes available with deprecation message until v8 we can change our code to work around the removal. |
There was a problem hiding this comment.
I actually moved the classes back to where they lived in astropy 6.1 and added them to that module's __all__
66ecc27 to
416e8e9
Compare
|
Re: deprecation - if there isn't an obvious simple replacement then I say we keep the classes and don't deprecate them, since they did look somewhat public before. We can always re-explore this in future to see if we can simplify things and if we want to deprecate anything, but unless there is a good reason to, we should keep them. |
|
The problem from cosmology is confusing.
It is either astropy/astropy/cosmology/_src/core.py Line 562 in a1ebee5 or astropy/astropy/cosmology/_src/core.py Line 571 in a1ebee5 @nstarman any idea? You using any ref magicks? |
|
p.s. Why are we reusing "mapping" so much? |
|
I've not had a chance to look into this but why was this not an issue before? |
|
This dup name thingy looks so familiar but I don't remember how we patched it before. Maybe it was patched for cosmo vs modeling, but now that viz introduces another one, it broke again. |
|
What if it is sphinx-doc/sphinx#10400 this time? Should we disable type checking in RTD? Is it enabled? |
|
The |
|
Ref: #10130 and astropy/astropy-APEs#85 for solution. |
|
@neutrinoceros - could we try what @timj suggested here? #17531 (comment) |
d5946dc to
99b5842
Compare
|
Done. Sorry it took me a couple days to get back to this ! |
|
RTD passes now. @astrofrog , are you able to do a final review? Thanks! 🙏 |
|
On my list for tomorrow! |
…b that were removed without deprecation in astropy 7.0.0
d848c04 to
3708ed7
Compare
|
Thanks, I somehow missed it ! done ! |
|
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
|
Oh no, auto backport failed. @neutrinoceros , do you mind manually backporting this? Thanks! |
|
Sure. I'll handle it tomorrow! |
…e classes from `astropy.visualization.lupton_rgb` that were removed without deprecation in astropy 7.0.0) API: reintroduce private classes from `astropy.visualization.lupton_rgb` that were removed without deprecation in astropy 7.0.0
|
done in #17697 |
Backport PR #17531 on branch `v7.0.x` (API: reintroduce private classes from `astropy.visualization.lupton_rgb` that were removed without deprecation in astropy 7.0.0)
Description
Follow up to #15081
Fixes #17528
I implemented the backward compatibility layer in a form that easily allows deprecation: re-introduced classes are isolated in their own (explicitly private) module, and re-exposed where needed, leaving room for an actual deprecation message.
However I didn't add the deprecation warning yet: this is meant to be backported, and my understanding is that deprecations cannot be added in patch releases. Maybe a pending deprecation is warranted ? in any case, we can properly deprecate these classes in astropy 7.1, with the recommended alternative being "just copy paste the source code if you really need these classes" (or maybe something more appropriate, @sedonaprice ?) ?
Note that I didn't find any doc or tests specifically attached to these classes and that should be ported from astropy 6.1.0