Preserve value of deprecated parameters without replacement#7552
Merged
lagru merged 1 commit intoscikit-image:mainfrom Oct 3, 2024
Merged
Preserve value of deprecated parameters without replacement#7552lagru merged 1 commit intoscikit-image:mainfrom
lagru merged 1 commit intoscikit-image:mainfrom
Conversation
Even if a parameter is deprecated, a value passed to it must be preserved during the deprecation cycle! Othwerwise, we effectively remove the deprecated behavior before the cycle is complete. This is only relevant if there's no replacement for the deprecated parameter. In that case, the given value preserved and passed to the replacing parameter, and the deprecated one can be overwritten with `DEPRECATED`.
Member
Author
|
This is technically a bug fix, but I'm not labeling it as such because this didn't affect our users as far as I'm aware. |
jarrodmillman
approved these changes
Oct 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Even if a parameter is deprecated, a value passed to it must be preserved during the deprecation cycle! Othwerwise, we effectively remove the deprecated behavior before the cycle is complete.
This is only relevant if there's no replacement for the deprecated parameter. In that case, the given value preserved and passed to the replacing parameter, and the deprecated one can be overwritten with
DEPRECATED.E.g.
should warn and print but only warns on
mainbecause it silently replaces withDEPRECATED.Thankfully, it doesn't look like we are currently using the decorator in a way that is affected by this bug. Discovered while preparing #7353.
Checklist
./doc/examplesfor new featuresRelease note
For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.