Skip to content

[Doc]: Improve animation.FuncAnimation.save - link parent methods in child's method documentation #24150

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kwsp opened this issue Oct 12, 2022 · 3 comments

Comments

@kwsp
Copy link
Contributor

kwsp commented Oct 12, 2022

Documentation Link

https://matplotlib.org/stable/api/_as_gen/matplotlib.animation.FuncAnimation.html

Problem

In https://matplotlib.org/stable/api/_as_gen/matplotlib.animation.FuncAnimation.html, the documentation of save is very incomplete. This is because save is a method inherited from the parent animation.Animation.

Suggested improvement

I think it would be extremely helpful to have a link to the parent's save method from animation.FuncAnimation's documentation base, as currently I don't think there is a straightforward way to find that documentation. I actually had to go to the source code of FuncAnimation, and follow up its inheritance tree to find where save was defined, then either read the docstring or find the corresponding method in the online documentation.

To extend this further - it would be helpful for all subclasses to have proper links to a parent method's documentation when the method isn't modified in the child.

@kwsp kwsp changed the title [Doc]: Improve animation.FuncAnimation.save [Doc]: Improve animation.FuncAnimation.save - link parent methods in child's method documentation Oct 12, 2022
@oscargus
Copy link
Member

There is often a Bases section which shows the parent classes, but this seems to be missing from the animation classes. In TimedAnimation this has been solved by explicitly mentioning the parent class https://matplotlib.org/stable/api/_as_gen/matplotlib.animation.TimedAnimation.html

While, of course, the best solution is to get the inheritance documentation working, a simple step to partly remedy this would be to do something similar.

@kwsp
Copy link
Contributor Author

kwsp commented Oct 14, 2022

I see. For now, I think we should specify that FuncAnimation is a subclass of TimedAnimation, then users can follow the docs up the inheritance tree to find the documentation for inherited methods.

I can try to investigate how we can get inheritance documentation working

@timhoffm
Copy link
Member

@kwsp kwsp closed this as completed Mar 18, 2023
@QuLogic QuLogic added this to the v3.6.2 milestone Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants