Skip to content

MNT: move ArtistList into artist module#31794

Open
rcomer wants to merge 2 commits into
matplotlib:mainfrom
rcomer:standalone-artistlist
Open

MNT: move ArtistList into artist module#31794
rcomer wants to merge 2 commits into
matplotlib:mainfrom
rcomer:standalone-artistlist

Conversation

@rcomer
Copy link
Copy Markdown
Member

@rcomer rcomer commented May 31, 2026

PR summary

Make ArtistList a standalone class in the artist module, and deprecate accessing as an attribute of the axes class. This is pulled out of #31746 to make the review easier. The only changes to the AxesList class are

  • White space
  • __init__ call sequence is now on one line
  • The isinstance call in __add__ now checks for ArtistList instead of Axes.ArtistList

I suspect this will need the second commit from #31746, but I'm curious to actually see the doc failure.

AI Disclosure

No AI used.

PR checklist

@github-actions github-actions Bot added topic: axes Documentation: tutorials files in galleries/tutorials labels May 31, 2026
rcomer added 2 commits May 31, 2026 12:29
The inheritance diagram in the artists API docs broke without these.
Copy link
Copy Markdown
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

Thanks, much easier to review 😄.

As expected, the doc failure is the same strange inheritance-diagram related failure as in the other PR.

@rcomer rcomer force-pushed the standalone-artistlist branch from a9d220f to 8e05633 Compare May 31, 2026 14:07
@rcomer
Copy link
Copy Markdown
Member Author

rcomer commented May 31, 2026

Force-pushed because I also needed to rename the changenote filename, and I wanted that in the first commit.

@rcomer
Copy link
Copy Markdown
Member Author

rcomer commented May 31, 2026

Notes on second commit for second reviewer:

For some reason, modifying the artist_api.rst triggered warnings and therefore a Circle-CI failure like this. I demonstrated that removing the inheritance diagram at the top of the file made the problem go away, so that seems to be the cause but I'm unclear why the inheritance diagram has not been a problem before now.

To fix it, I went ahead and added docs for the missing private artists.

For _ImageBase and _AnnotationBase I think these are reasonable to include as they have useful methods that do not show in the docs for the public arists. E.g. get_shape, get_size, set_data on _ImageBase and get/set_annotation_clip on _AnnotationBase.

For _AxesBase I made it as unobtrusive as possible.

@rcomer rcomer changed the title MNT: move Artistlist into artist module MNT: move ArtistList into artist module May 31, 2026
@rcomer rcomer added this to the v3.12.0 milestone Jun 2, 2026
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.

2 participants