mirror of
https://github.com/3b1b/manim.git
synced 2025-07-28 20:43:56 +08:00
After running 2to3
This commit is contained in:
@ -463,7 +463,7 @@ class WantToLearnQM(TeacherStudentsScene):
|
||||
self.wait(2)
|
||||
self.teacher_says(
|
||||
"First, lots and lots \\\\ of linear algebra",
|
||||
added_anims = map(FadeOut, bubbles)
|
||||
added_anims = list(map(FadeOut, bubbles))
|
||||
)
|
||||
self.wait()
|
||||
|
||||
@ -895,7 +895,7 @@ class CurlRelationBetweenFields(ThreeDScene):
|
||||
|
||||
self.play(
|
||||
ShowCreation(M_vects, run_time = 2),
|
||||
*map(FadeOut, self.E_vects[1:])
|
||||
*list(map(FadeOut, self.E_vects[1:]))
|
||||
)
|
||||
self.wait()
|
||||
self.play(
|
||||
@ -1008,11 +1008,11 @@ class ListRelevantWaveIdeas(TeacherStudentsScene):
|
||||
h_line = Line(title.get_left(), title.get_right())
|
||||
h_line.next_to(title, DOWN, SMALL_BUFF)
|
||||
|
||||
topics = VGroup(*map(TextMobject, [
|
||||
topics = VGroup(*list(map(TextMobject, [
|
||||
"- Superposition",
|
||||
"- Amplitudes",
|
||||
"- How phase influences addition",
|
||||
]))
|
||||
])))
|
||||
topics.scale(0.8)
|
||||
topics.arrange_submobjects(DOWN, aligned_edge = LEFT)
|
||||
topics.next_to(h_line, DOWN, aligned_edge = LEFT)
|
||||
@ -1240,7 +1240,7 @@ class ShowVectorEquation(Scene):
|
||||
y_min = -1.5,
|
||||
y_max = 1.5,
|
||||
)
|
||||
axes.x_axis.add_numbers(*range(1, 6))
|
||||
axes.x_axis.add_numbers(*list(range(1, 6)))
|
||||
t = TexMobject("t")
|
||||
t.next_to(axes.x_axis, UP, SMALL_BUFF, RIGHT)
|
||||
cos = self.x_without_phi.copy()
|
||||
@ -1357,7 +1357,7 @@ class ShowVectorEquation(Scene):
|
||||
ShowCreation(arrow)
|
||||
)
|
||||
self.wait(3)
|
||||
self.play(*map(FadeOut, [words, arrow]))
|
||||
self.play(*list(map(FadeOut, [words, arrow])))
|
||||
|
||||
self.corner_cos.add(corner_phi)
|
||||
|
||||
@ -1449,16 +1449,16 @@ class ShowVectorEquation(Scene):
|
||||
Arrow(kets_word.get_top(), ket, color = ket.get_color())
|
||||
for ket in kets
|
||||
])
|
||||
ket_rects = VGroup(*map(SurroundingRectangle, kets))
|
||||
ket_rects = VGroup(*list(map(SurroundingRectangle, kets)))
|
||||
ket_rects.set_color(WHITE)
|
||||
unit_vectors = VGroup(*[Vector(2*vect) for vect in (RIGHT, UP)])
|
||||
unit_vectors.set_fill(YELLOW)
|
||||
|
||||
self.play(
|
||||
FadeOut(self.brackets),
|
||||
*map(MoveToTarget, [E_equals, x, y])
|
||||
*list(map(MoveToTarget, [E_equals, x, y]))
|
||||
)
|
||||
self.play(*map(Write, [right_ket, plus, up_ket]), run_time = 1)
|
||||
self.play(*list(map(Write, [right_ket, plus, up_ket])), run_time = 1)
|
||||
self.play(
|
||||
Write(kets_word),
|
||||
LaggedStart(ShowCreation, arrows, lag_ratio = 0.7),
|
||||
@ -1471,7 +1471,7 @@ class ShowVectorEquation(Scene):
|
||||
self.play(ReplacementTransform(ket[1][1].copy(), unit_vect))
|
||||
self.wait()
|
||||
self.play(FadeOut(unit_vectors))
|
||||
self.play(*map(FadeOut, [kets_word, arrows]))
|
||||
self.play(*list(map(FadeOut, [kets_word, arrows])))
|
||||
|
||||
self.kets = kets
|
||||
self.plus = plus
|
||||
@ -1521,12 +1521,12 @@ class ShowVectorEquation(Scene):
|
||||
Transform(self.h_brace, new_h_brace),
|
||||
self.h_brace.A.next_to, new_h_brace, RIGHT, SMALL_BUFF,
|
||||
Transform(self.horizontally_polarized_words, words),
|
||||
*map(FadeOut, [
|
||||
*list(map(FadeOut, [
|
||||
self.corner_group, self.v_brace,
|
||||
self.v_brace.A, self.low_f_graph,
|
||||
])
|
||||
]))
|
||||
)
|
||||
self.play(*map(MoveToTarget, movers))
|
||||
self.play(*list(map(MoveToTarget, movers)))
|
||||
self.wait(5)
|
||||
|
||||
class ChangeFromHorizontalToVerticallyPolarized(DirectionOfPolarizationScene):
|
||||
@ -1587,7 +1587,7 @@ class SumOfTwoWaves(ChangeFromHorizontalToVerticallyPolarized):
|
||||
self.set_camera_position(0.95*np.pi/2, -0.03*np.pi)
|
||||
|
||||
def construct(self):
|
||||
plus, equals = pe = VGroup(*map(TexMobject, "+="))
|
||||
plus, equals = pe = VGroup(*list(map(TexMobject, "+=")))
|
||||
pe.scale(2)
|
||||
pe.rotate(np.pi/2, RIGHT)
|
||||
pe.rotate(np.pi/2, OUT)
|
||||
@ -1681,9 +1681,9 @@ class ShowTipToTailSum(ShowVectorEquation):
|
||||
h_line.update(h_line)
|
||||
v_line.update(v_line)
|
||||
self.play(*it.chain(
|
||||
map(MoveToTarget, self.kets),
|
||||
list(map(MoveToTarget, self.kets)),
|
||||
[Write(plus)],
|
||||
map(ShowCreation, [h_line, v_line]),
|
||||
list(map(ShowCreation, [h_line, v_line])),
|
||||
))
|
||||
blue_black = average_color(BLUE, BLACK)
|
||||
self.play(
|
||||
@ -1766,8 +1766,8 @@ class ShowTipToTailSum(ShowVectorEquation):
|
||||
|
||||
|
||||
self.play(*it.chain(
|
||||
map(MoveToTarget, self.ket_sum),
|
||||
map(Write, A_mobs),
|
||||
list(map(MoveToTarget, self.ket_sum)),
|
||||
list(map(Write, A_mobs)),
|
||||
[
|
||||
UpdateFromAlphaFunc(
|
||||
ov.vector,
|
||||
@ -2047,7 +2047,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene):
|
||||
|
||||
self.play(
|
||||
Write(words, run_time = 2),
|
||||
*map(GrowFromCenter, lines)
|
||||
*list(map(GrowFromCenter, lines))
|
||||
)
|
||||
self.wait(6)
|
||||
self.play(FadeOut(lines))
|
||||
@ -2494,7 +2494,7 @@ class DescribePhoton(ThreeDScene):
|
||||
y_unit_size = 2,
|
||||
y_radius = FRAME_X_RADIUS,
|
||||
)
|
||||
plane.add_coordinates(x_vals = range(-3, 4), y_vals = [])
|
||||
plane.add_coordinates(x_vals = list(range(-3, 4)), y_vals = [])
|
||||
plane.rotate(np.pi/2, RIGHT)
|
||||
plane.rotate(np.pi/2, OUT)
|
||||
|
||||
@ -2583,7 +2583,7 @@ class DescribePhoton(ThreeDScene):
|
||||
Write(word, run_time = 1)
|
||||
)
|
||||
self.wait()
|
||||
self.play(*map(FadeOut, [new_alpha, group]))
|
||||
self.play(*list(map(FadeOut, [new_alpha, group])))
|
||||
|
||||
def change_basis(self):
|
||||
superposition = self.superposition
|
||||
@ -2647,7 +2647,7 @@ class DescribePhoton(ThreeDScene):
|
||||
|
||||
self.equation.generate_target()
|
||||
|
||||
self.play(*map(MoveToTarget, movers))
|
||||
self.play(*list(map(MoveToTarget, movers)))
|
||||
self.wait(2)
|
||||
self.play(*[mob.restore for mob in movers])
|
||||
self.wait()
|
||||
@ -2676,11 +2676,11 @@ class DescribePhoton(ThreeDScene):
|
||||
rate_func = squish_rate_func(there_and_back)
|
||||
))
|
||||
self.wait()
|
||||
self.play(*map(FadeOut, [
|
||||
self.play(*list(map(FadeOut, [
|
||||
morty, words, rect,
|
||||
self.equation.rect,
|
||||
self.equation.words,
|
||||
]))
|
||||
])))
|
||||
|
||||
def write_components(self):
|
||||
d_brace = Brace(Line(ORIGIN, 2*RIGHT), UP, buff = SMALL_BUFF)
|
||||
@ -2849,7 +2849,7 @@ class DescribePhoton(ThreeDScene):
|
||||
everything.remove(self.photon.mobject)
|
||||
everything.remove(self.axes)
|
||||
|
||||
self.play(*map(FadeOut, everything))
|
||||
self.play(*list(map(FadeOut, everything)))
|
||||
self.move_camera(
|
||||
phi = 0.8*np.pi/2,
|
||||
theta = -0.3*np.pi,
|
||||
@ -3017,7 +3017,7 @@ class ShootPhotonThroughFilter(DirectionOfPolarizationScene):
|
||||
self.play(
|
||||
Write(words, run_time = 2),
|
||||
self.superposition_tex.h_rect.set_stroke, RED, 3,
|
||||
*map(GrowFromCenter, lines)+\
|
||||
*list(map(GrowFromCenter, lines))+\
|
||||
[
|
||||
Animation(self.pol_filter),
|
||||
Animation(self.frozen_photon.mobject)
|
||||
@ -3339,7 +3339,7 @@ class ThreeFilters(ShootPhotonThroughFilter):
|
||||
use_rectangular_stem = False,
|
||||
path_arc = 0.5*np.pi,
|
||||
)
|
||||
labels = VGroup(*map(TexMobject, ["0\\%", "25\\%"]))
|
||||
labels = VGroup(*list(map(TexMobject, ["0\\%", "25\\%"])))
|
||||
labels.scale(1.5)
|
||||
labels.next_to(arrow, DOWN)
|
||||
group = VGroup(arrow, labels)
|
||||
@ -3405,7 +3405,7 @@ class ThreeFilters(ShootPhotonThroughFilter):
|
||||
n_to_block = int((1-ratio)*self.n_lines)
|
||||
random.seed(self.random_seed)
|
||||
indices_to_block = random.sample(
|
||||
range(self.n_lines), n_to_block
|
||||
list(range(self.n_lines)), n_to_block
|
||||
)
|
||||
VGroup(*[lines[i] for i in indices_to_block]).set_stroke(width = 0)
|
||||
return lines
|
||||
|
Reference in New Issue
Block a user