MNT: move ArtistList into artist module#31794
Conversation
timhoffm
left a comment
There was a problem hiding this comment.
Thanks, much easier to review 😄.
As expected, the doc failure is the same strange inheritance-diagram related failure as in the other PR.
a9d220f to
8e05633
Compare
|
Force-pushed because I also needed to rename the changenote filename, and I wanted that in the first commit. |
|
Notes on second commit for second reviewer: For some reason, modifying the To fix it, I went ahead and added docs for the missing private artists. For For |
QuLogic
left a comment
There was a problem hiding this comment.
I will note that all the doc problems were already listed in doc/missing-references.json, but at a different line number. So if you've fixed them, then you should remove the entries from there.
| @@ -0,0 +1,3 @@ | |||
| The ``Axes.AxesList`` attribute | |||
| def pprint_getters(self) -> list[str]: ... | ||
|
|
||
|
|
||
| class ArtistList(Sequence[_T_Artist]): |
Ah, I didn't know about that file! I had hit the same docs failures after I modified |
|
I had heard of that file but never made the effort to learn what it's about! Thanks @QuLogic it's good to have an explanation. |
|
I am in two minds what to do about the |
8e05633 to
b28308f
Compare
There was a problem hiding this comment.
See my previous comment #31794 (comment). I’m not sure whether to remove this or revert the doc addition.
There was a problem hiding this comment.
IMHO private base classes are an inconsistent concept. They "should not be used" but OTOH provide public functionality. We should come up with a strategy how to handle them. But that is beyound the scope of this PR.
As far as we are concerned here, we just have the problem of missing references due to undocumented base classes, and our current imperfect solution is to list them in missing-references. I'm inclined to do this here and defer everything else to a follow-up.
Side-note: It's a bit annoying that JSON does not support comments, which we could have used to annotate where the missing reference is coming from.
There was a problem hiding this comment.
OK - so I should drop the second commit completely and just update the line numbers in the json?
There was a problem hiding this comment.
That would be my way forward. You can reuse the second commit as a baseline for a follow-up.
There was a problem hiding this comment.
OK, the second commit is now saved in its own branch for future reference https://github.com/rcomer/matplotlib/tree/private-artist-docs
There was a problem hiding this comment.
👍 It's a known issue that the line number is part of the message and when code moves, the line number match gets lost. In the past, we corrected the line numbers as is now done here. Future improvements could be to remove the missing reference or make the matching more permissive.
b28308f to
74ea04e
Compare
PR summary
Make
ArtistLista standalone class in theartistmodule, 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 theAxesListclass are__init__call sequence is now on one lineisinstancecall in__add__now checks forArtistListinstead ofAxes.ArtistListI 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