Skip to content
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

Remove deprecated code from wcs #15504

Merged
merged 2 commits into from Oct 26, 2023
Merged

Remove deprecated code from wcs #15504

merged 2 commits into from Oct 26, 2023

Conversation

eerovaher
Copy link
Member

Description

The first commit removes code deprecated in #10229. The users are meant to import things from astropy.wcs.wcsapi and apparently the internals of that module are considered private. The deprecation therefore had no change log entry, and the removal of the code shouldn't have an entry either.

The second commit removes code deprecated in #6682. There were no change log entries announcing the deprecation, so likewise there's no entry announcing the removal.

There is one more deprecated function:

astropy/astropy/wcs/wcs.py

Lines 966 to 972 in 98d82dd

def _read_d2im_old_format(self, header, fobj, axiscorr):
warnings.warn(
"The use of ``AXISCORR`` for D2IM correction has been"
" deprecated.`~astropy.wcs` will read in files with ``AXISCORR`` but"
" ``to_fits()`` will write out files without it.",
AstropyDeprecationWarning,
)

But in this case I'm not sure if removing the deprecated function is the right thing to do. Maybe the warning type should be changed instead. I'd prefer if someone more familiar with wcs would have a look at this.

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

@github-actions
Copy link

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.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • Is a milestone set? Milestone must be set but we cannot check for it on Actions; do not let the green checkmark fool you.
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

Copy link
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a change log. Thanks!

astropy/wcs/wcs.py Show resolved Hide resolved
@pllim pllim added the API change PRs and issues that change an existing API, possibly requiring a deprecation period label Oct 18, 2023
@pllim
Copy link
Member

pllim commented Oct 19, 2023

Still need a change log.

@eerovaher
Copy link
Member Author

I'd first like to know what should be done with _read_d2im_old_format().

@pllim
Copy link
Member

pllim commented Oct 19, 2023

This? Yeah, not sure. Looks like the warning is always emitted if this gets called. Maybe @mcara would know. But this can also be a follow-up PR because I feel like bigger changes are needed to get rid of this warning.

    def _read_d2im_old_format(self, header, fobj, axiscorr):
        warnings.warn(
            "The use of ``AXISCORR`` for D2IM correction has been"
            " deprecated.`~astropy.wcs` will read in files with ``AXISCORR`` but"
            " ``to_fits()`` will write out files without it.",
            AstropyDeprecationWarning,
        )

@eerovaher
Copy link
Member Author

To elaborate: from the deprecation warning in _read_d2im_old_format() it is not clear to me that reading files with AXISCORR is or even should be deprecated, so it's not obvious to me that this function should be removed. Should it be the case that the warning type needs to be changed, but doing that is not trivial, then it would indeed be a good idea to leave it for a dedicated pull request, but I'd still like that to be decided here.

This is a follow-up to ec55022 (Moved
wrapper classes into .wrappers sub-module.).
This is a follow-up to f9f5087 (Make
some kwargs-arguments named keyword-only arguments).
@eerovaher
Copy link
Member Author

I haven't heard anything about _read_d2im_old_format(), but that shouldn't prevent the removal of other deprecated code. As far as I can tell the file that actually defines SlicedLowLevelWCS is not considered to be part of the public API and there was no change log entry for deprecating the old file, so I haven't added a change log entry for its removal either. For NoConvergence **kwargs I added a change log entry like @pllim requested. I also rebased the pull request to pick up the RTD configuration update from yesterday.

Copy link
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now. Thanks!

@pllim pllim merged commit ebefb4f into astropy:main Oct 26, 2023
25 of 27 checks passed
@eerovaher eerovaher deleted the clean-wcs branch October 26, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change PRs and issues that change an existing API, possibly requiring a deprecation period testing wcs.wcsapi wcs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants