Add unobtrusive deprecation note to the first line of the docstring #12738
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.
PR Summary
As suggested in #12736 (review), this PR adds an unobtrusive "Deprecated." to the beginning of the docstring.
This is intended particularly for the summary.
A maybe slightly unwanted side-effect is that this is of course also present in the docstring, which is a duplication with the more verbose deprecation note.
However, every other way of adding such a not to the summary is far more complicated. It would have to happen within
autosummary
, which has to be patched or extended for that functionality. Also for a universal extension ofautosummary
, there would be the problem of detecting a deprecated method. So overall, the solution presented here is preferable due to its simplicity.