-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
handle_play_like_call decorator to use functools.wraps #1357
Conversation
this way, decorated methods - typically Scene.play - have a decent docstring so first-time users can use help()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there are two more wrappers. You can also improve them by the way:
manim/manimlib/mobject/mobject.py
Lines 1289 to 1295 in 8f52c7b
def affects_shader_info_id(func): | |
def wrapper(self): | |
for mob in self.get_family(): | |
func(mob) | |
mob.refresh_shader_wrapper_id() | |
return self | |
return wrapper |
manim/manimlib/mobject/types/vectorized_mobject.py
Lines 809 to 816 in 8f52c7b
def triggers_refreshed_triangulation(func): | |
def wrapper(self, *args, **kwargs): | |
old_points = self.get_points() | |
func(self, *args, **kwargs) | |
if not np.all(self.get_points() == old_points): | |
self.refresh_triangulation() | |
self.refresh_unit_normal() | |
return wrapper |
that's right, I had proposed to take care of that in my initial PR, but had forgotten about all this in the meanwhile :) I am in no position to test all this though at this time, the code I had written in summer last year looks broken with the current version (where is the in any case, here you go ... |
This version has been developed since last year, so |
are you suggesting I use the community version instead if I need many thanks for the feedback ! |
It may be that |
this is a remake of #1204 on the current master
this way, decorated methods - typically Scene.play - have a decent docstring
so first-time users can use help()