Skip to content

Removed the deprecated code from offsetbox.py#26910

Merged
QuLogic merged 8 commits intomatplotlib:mainfrom
jpgianfaldoni:remove-deprecated-offsetbox
Sep 25, 2023
Merged

Removed the deprecated code from offsetbox.py#26910
QuLogic merged 8 commits intomatplotlib:mainfrom
jpgianfaldoni:remove-deprecated-offsetbox

Conversation

@jpgianfaldoni
Copy link
Copy Markdown
Contributor

@jpgianfaldoni jpgianfaldoni commented Sep 25, 2023

PR summary

This PR removes the deprecated code during the version 3.7 from lib/matplotlib/offsetbox.py which is a sub issue in the parent issues here: #26865
-->

PR checklist

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

Copy link
Copy Markdown
Member

@ksunden ksunden left a comment

Choose a reason for hiding this comment

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

Just a bit of an adjustment to the release note,

These methods have alternatives that should be mentioned here, though you can largely copy/paste from the deprecation notice, just reflecting that they are removed rather than deprecated

Comment on lines +1 to +10
``bbox_artist``
~~~~~~~~~~~~~~~~
... of `matplotlib.offsetbox` is removed without replacements.
``get_extent_offsets``
~~~~~~~~~~~~~~~~~~~~~~~

... of `matplotlib.offsetbox` is removed without replacements.
``get_extent``
~~~~~~~~~~~~~~~
... of `matplotlib.offsetbox` is removed without replacements.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All of these have alternatives that are mentioned in the deprecation decorator, so they are not removed "without replacements"

See the deprecation note, which can be modified to reflect the "removed" rather than "deprecated":

``offsetbox.bbox_artist``
~~~~~~~~~~~~~~~~~~~~~~~~~
... is deprecated. This is just a wrapper to call `.patches.bbox_artist` if a
flag is set in the file, so use that directly if you need the behavior.

``OffsetBox.get_extent_offsets`` and ``OffsetBox.get_extent``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
... are deprecated; these methods are also deprecated on all subclasses of
`.OffsetBox`.
To get the offsetbox extents, instead of ``get_extent``, use
`.OffsetBox.get_bbox`, which directly returns a `.Bbox` instance.
To also get the child offsets, instead of ``get_extent_offsets``, separately
call `~.OffsetBox.get_offset` on each children after triggering a draw.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ksunden changed the rst file to reflect the requested changes. Please let me know if any more modifications are needed.

Comment thread doc/api/next_api_changes/removals/26910-JP.rst Outdated
Co-authored-by: Kyle Sunden <git@ksunden.space>
Copy link
Copy Markdown
Member

@rcomer rcomer left a comment

Choose a reason for hiding this comment

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

Just a couple of very minor things!

Comment thread doc/api/next_api_changes/removals/26910-JP.rst Outdated
Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
Copy link
Copy Markdown
Member

@rcomer rcomer left a comment

Choose a reason for hiding this comment

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

Thanks @jpgianfaldoni! This can be merged once the checks pass again.

@QuLogic
Copy link
Copy Markdown
Member

QuLogic commented Sep 25, 2023

Thanks @jpgianfaldoni! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again.

@ksunden ksunden added this to the v3.9.0 milestone Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants