mirror of
https://github.com/3b1b/manim.git
synced 2025-08-02 02:35:22 +08:00
After running 2to3
This commit is contained in:
@ -70,10 +70,10 @@ class Animation(object):
|
||||
return self.mobject, self.starting_mobject
|
||||
|
||||
def get_all_families_zipped(self):
|
||||
return zip(*map(
|
||||
return list(zip(*list(map(
|
||||
Mobject.family_members_with_points,
|
||||
self.get_all_mobjects()
|
||||
))
|
||||
))))
|
||||
|
||||
def get_sub_alpha(self, alpha, index, num_submobjects):
|
||||
if self.submobject_mode in ["lagged_start", "smoothed_lagged_start"]:
|
||||
|
@ -1,5 +1,5 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import print_function
|
||||
|
||||
|
||||
|
||||
import itertools as it
|
||||
import numpy as np
|
||||
@ -81,7 +81,7 @@ class Succession(Animation):
|
||||
for anim in animations:
|
||||
anim.update(0)
|
||||
|
||||
animations = filter(lambda x: not(x.empty), animations)
|
||||
animations = [x for x in animations if not(x.empty)]
|
||||
|
||||
self.run_times = [anim.run_time for anim in animations]
|
||||
if "run_time" in kwargs:
|
||||
@ -100,8 +100,8 @@ class Succession(Animation):
|
||||
# critical_alphas[i] is the start alpha of self.animations[i]
|
||||
# critical_alphas[i + 1] is the end alpha of self.animations[i]
|
||||
critical_times = np.concatenate(([0], np.cumsum(self.run_times)))
|
||||
self.critical_alphas = map(lambda x: np.true_divide(
|
||||
x, run_time), critical_times) if self.num_anims > 0 else [0.0]
|
||||
self.critical_alphas = [np.true_divide(
|
||||
x, run_time) for x in critical_times] if self.num_anims > 0 else [0.0]
|
||||
|
||||
# self.scene_mobjects_at_time[i] is the scene's mobjects at start of self.animations[i]
|
||||
# self.scene_mobjects_at_time[i + 1] is the scene mobjects at end of self.animations[i]
|
||||
@ -149,7 +149,7 @@ class Succession(Animation):
|
||||
|
||||
gt_alpha_iter = it.ifilter(
|
||||
lambda i: self.critical_alphas[i + 1] >= alpha,
|
||||
range(self.num_anims)
|
||||
list(range(self.num_anims))
|
||||
)
|
||||
i = next(gt_alpha_iter, None)
|
||||
if i is None:
|
||||
@ -188,7 +188,7 @@ class AnimationGroup(Animation):
|
||||
}
|
||||
|
||||
def __init__(self, *sub_anims, **kwargs):
|
||||
sub_anims = filter(lambda x: not(x.empty), sub_anims)
|
||||
sub_anims = [x for x in sub_anims if not(x.empty)]
|
||||
digest_config(self, locals())
|
||||
self.update_config(**kwargs) # Handles propagation to self.sub_anims
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
import numpy as np
|
||||
|
||||
@ -221,10 +221,10 @@ class Vibrate(Animation):
|
||||
|
||||
def update_mobject(self, alpha):
|
||||
time = alpha * self.run_time
|
||||
families = map(
|
||||
families = list(map(
|
||||
Mobject.submobject_family,
|
||||
[self.mobject, self.starting_mobject]
|
||||
)
|
||||
))
|
||||
for mob, start in zip(*families):
|
||||
mob.points = np.apply_along_axis(
|
||||
lambda x_y_z: (x_y_z[0], x_y_z[1] + self.wave_function(x_y_z[0], time), x_y_z[2]),
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
from constants import *
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
from constants import *
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
import inspect
|
||||
import numpy as np
|
||||
|
@ -1,4 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
|
||||
from constants import *
|
||||
|
||||
|
Reference in New Issue
Block a user