Skip to content
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

Merged
merged 2 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions manimlib/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import random
import sys
import moderngl
from functools import wraps

import numpy as np

Expand Down Expand Up @@ -1287,6 +1288,7 @@ def unlock_data(self):
# Operations touching shader uniforms

def affects_shader_info_id(func):
@wraps(func)
def wrapper(self):
for mob in self.get_family():
func(mob)
Expand Down
3 changes: 2 additions & 1 deletion manimlib/mobject/types/vectorized_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import operator as op
import moderngl

from functools import reduce
from functools import reduce, wraps

from manimlib.constants import *
from manimlib.mobject.mobject import Mobject
Expand Down Expand Up @@ -807,6 +807,7 @@ def get_triangulation(self, normal_vector=None):
return tri_indices

def triggers_refreshed_triangulation(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
old_points = self.get_points()
func(self, *args, **kwargs)
Expand Down
2 changes: 2 additions & 0 deletions manimlib/scene/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import platform
import itertools as it
import logging
from functools import wraps

from tqdm import tqdm as ProgressDisplay
import numpy as np
Expand Down Expand Up @@ -372,6 +373,7 @@ def compile_method(state):
return animations

def handle_play_like_call(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
self.update_skipping_status()
should_write = not self.skip_animations
Expand Down