Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Use a dataclass instead of a dict as a return type for boxplot()#27788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This is an interesting idea! This also seems to be a step in the right direction for maybe having this object be in the draw tree (rather than all of the parts individually). We should also put a |
timhoffm commentedFeb 14, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes, we could extend this to something like an ArtistContainer, which itself can support (parts of) the Artist API. But let's start small. |
f6cd232
toef3d7e9
Compare0968c26
to9652073
CompareI just realized that we have |
This is a prove of concept. Backward compatibility is achieved thougha collections.abc.Mapping mixin. Note though, that I did not go as faras MutableMapping. If someone has written to the returned dict, theywould still be broken.open issues:- documentation incomplete- should switch usages in the matplotlib code to attributes- Where to put the dataclass? cbook or axes?- should we use silent_list to make the repr a bit nicer?
Put to draft to rethink this approach vs. Container. Feedback welcome. |
Uh oh!
There was an error while loading.Please reload this page.
This is a prove of concept. Backward compatibility is achieved though a collections.abc.Mapping mixin. Note though, that I did not go as far as MutableMapping. If someone has written to the returned dict, they would still be broken.
open issues:
should we use silent_list to make the repr a bit nicer?-> not for now. There's value in having a plain
list
. If we want to improve the repr, rather implement a specialrepr
forBoxplotArtists
. But that can be done later.