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:
@ -32,11 +32,11 @@ class RearrangeEquation(Scene):
|
||||
[n % len(start_mobs) for n in index_map]
|
||||
)
|
||||
unmatched_end_indices.difference_update(
|
||||
[n % len(end_mobs) for n in index_map.values()]
|
||||
[n % len(end_mobs) for n in list(index_map.values())]
|
||||
)
|
||||
mobject_pairs = [
|
||||
(start_mobs[a], end_mobs[b])
|
||||
for a, b in index_map.iteritems()
|
||||
for a, b in index_map.items()
|
||||
] + [
|
||||
(Point(end_mobs[b].get_center()), end_mobs[b])
|
||||
for b in unmatched_end_indices
|
||||
|
@ -52,7 +52,7 @@ class ComplexTransformationScene(Scene):
|
||||
def play(self, *animations, **kwargs):
|
||||
Scene.play(
|
||||
self,
|
||||
*list(animations) + map(Animation, self.foreground_mobjects),
|
||||
*list(animations) + list(map(Animation, self.foreground_mobjects)),
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
@ -32,7 +32,7 @@ def fractalify(vmobject, order=3, *args, **kwargs):
|
||||
return vmobject
|
||||
|
||||
|
||||
def fractalification_iteration(vmobject, dimension=1.05, num_inserted_anchors_range=range(1, 4)):
|
||||
def fractalification_iteration(vmobject, dimension=1.05, num_inserted_anchors_range=list(range(1, 4))):
|
||||
num_points = vmobject.get_num_points()
|
||||
if num_points > 0:
|
||||
# original_anchors = vmobject.get_anchors()
|
||||
@ -667,7 +667,7 @@ class SnakeCurve(FractalCurve):
|
||||
DOWN * (self.radius - step / 2)
|
||||
|
||||
for y in range(resolution):
|
||||
x_range = range(resolution)
|
||||
x_range = list(range(resolution))
|
||||
if y % 2 == 0:
|
||||
x_range.reverse()
|
||||
for x in x_range:
|
||||
|
@ -170,7 +170,7 @@ class CompleteGraph(Graph):
|
||||
for x in range(self.num_vertices)
|
||||
for theta in [2 * np.pi * x / self.num_vertices]
|
||||
]
|
||||
self.edges = it.combinations(range(self.num_vertices), 2)
|
||||
self.edges = it.combinations(list(range(self.num_vertices)), 2)
|
||||
|
||||
def __str__(self):
|
||||
return Graph.__str__(self) + str(self.num_vertices)
|
||||
@ -193,7 +193,7 @@ class DiscreteGraphScene(Scene):
|
||||
Scene.__init__(self, *args, **kwargs)
|
||||
|
||||
def construct(self):
|
||||
self.points = map(np.array, self.graph.vertices)
|
||||
self.points = list(map(np.array, self.graph.vertices))
|
||||
self.vertices = self.dots = [Dot(p) for p in self.points]
|
||||
self.edges = self.lines = [
|
||||
Line(self.points[i], self.points[j])
|
||||
@ -263,7 +263,7 @@ class DiscreteGraphScene(Scene):
|
||||
])
|
||||
|
||||
def annotate_edges(self, mobject, fade_in=True, **kwargs):
|
||||
angles = map(np.arctan, map(Line.get_slope, self.edges))
|
||||
angles = list(map(np.arctan, list(map(Line.get_slope, self.edges))))
|
||||
self.edge_annotations = [
|
||||
mobject.copy().rotate(angle).move_to(edge.get_center())
|
||||
for angle, edge in zip(angles, self.edges)
|
||||
@ -320,7 +320,7 @@ class DiscreteGraphScene(Scene):
|
||||
self.generate_spanning_tree()
|
||||
root = self.spanning_tree_root
|
||||
color = self.spanning_tree.get_color()
|
||||
indices = range(len(self.points))
|
||||
indices = list(range(len(self.points)))
|
||||
# Build dicts
|
||||
parent_of = dict([
|
||||
tuple(reversed(pair))
|
||||
|
@ -242,10 +242,10 @@ class Spotlight(VMobject):
|
||||
def viewing_angles(self, screen):
|
||||
|
||||
screen_points = screen.get_anchors()
|
||||
projected_screen_points = map(self.project, screen_points)
|
||||
projected_screen_points = list(map(self.project, screen_points))
|
||||
|
||||
viewing_angles = np.array(map(self.viewing_angle_of_point,
|
||||
projected_screen_points))
|
||||
viewing_angles = np.array(list(map(self.viewing_angle_of_point,
|
||||
projected_screen_points)))
|
||||
|
||||
lower_angle = upper_angle = 0
|
||||
if len(viewing_angles) != 0:
|
||||
|
Reference in New Issue
Block a user