Skip to content

Commit

Permalink
Merge pull request #7 from 3b1b/master
Browse files Browse the repository at this point in the history
Updating to a newer version of manim
  • Loading branch information
vivek3141 authored Feb 15, 2019
2 parents 0a81699 + 295c645 commit 1e2f41a
Show file tree
Hide file tree
Showing 69 changed files with 1,040 additions and 1,015 deletions.
26 changes: 13 additions & 13 deletions active_projects/eola2/cramer.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,13 @@ def introduce_system(self):

self.add(system)
self.wait()
self.play(OldLaggedStart(
self.play(LaggedStartMap(
ApplyMethod, unknown_circles,
lambda m: (m.restore,),
lag_ratio=0.7
))
self.play(FadeOut(unknown_circles))
self.play(OldLaggedStart(ShowCreation, row_rects,
self.play(LaggedStartMap(ShowCreation, row_rects,
run_time=1, lag_ratio=0.8))
self.play(FadeOut(row_rects))
self.wait()
Expand Down Expand Up @@ -818,7 +818,7 @@ def update_dashed_lines(lines):
lines[i].shift(basis_vectors[1 - i].get_end() - origin)
return lines
update_dashed_lines(dashed_lines)
self.play(OldLaggedStart(ShowCreation, dashed_lines, lag_ratio=0.7))
self.play(LaggedStartMap(ShowCreation, dashed_lines, lag_ratio=0.7))
for basis in basis_vectors:
self.play(
MoveToTarget(basis, run_time=2),
Expand Down Expand Up @@ -990,28 +990,28 @@ def show_dot_products(self):
MoveToTarget(corner_rect),
Animation(self.equations),
FadeOut(self.to_fade),
OldLaggedStart(Write, implications),
LaggedStartMap(Write, implications),
)
self.remove(self.input_vect_mob)
self.apply_matrix(self.matrix, added_anims=[
Animation(VGroup(corner_rect, self.equations, implications)),
MoveToTarget(moving_equations[0]),
OldLaggedStart(FadeIn, transformed_equations[0].parts_to_write),
LaggedStartMap(FadeIn, transformed_equations[0].parts_to_write),
FadeIn(self.column_mobs),
ReplacementTransform(
self.input_vect_mob.copy(), self.output_vect_mob)
])
self.play(
MoveToTarget(moving_equations[1]),
OldLaggedStart(FadeIn, transformed_equations[1].parts_to_write),
LaggedStartMap(FadeIn, transformed_equations[1].parts_to_write),
path_arc=-30 * DEGREES,
run_time=2
)
self.wait()

# Show rectangles
self.play(
OldLaggedStart(ShowCreation, transformed_input_rects, lag_ratio=0.8),
LaggedStartMap(ShowCreation, transformed_input_rects, lag_ratio=0.8),
ShowCreation(self.output_vect_label.rect),
)
for tbr, column_mob in zip(transformed_basis_rects, self.column_mobs):
Expand Down Expand Up @@ -1265,7 +1265,7 @@ def construct(self):

self.apply_matrix(matrix)
self.wait()
self.play(OldLaggedStart(ShowCreation, output_dashed_lines))
self.play(LaggedStartMap(ShowCreation, output_dashed_lines))
self.play(*self.get_column_animations(system.matrix_mobject, column_mobs))
self.wait()
self.remove(*output_dashed_lines)
Expand Down Expand Up @@ -1325,7 +1325,7 @@ def construct(self):
anims = [
FadeIn(equation.background_rectangle),
Write(equation.to_write),
OldLaggedStart(
LaggedStartMap(
MoveToTarget, equation.movers,
path_arc=60 * DEGREES
)
Expand Down Expand Up @@ -1566,7 +1566,7 @@ def update_brace_group(brace_group):
)

# Fade out unneeded bits
self.play(OldLaggedStart(FadeOut, VGroup(
self.play(LaggedStartMap(FadeOut, VGroup(
unit_brace, one, coord_brace, coord_brace.label,
)))

Expand Down Expand Up @@ -1630,7 +1630,7 @@ def transform_space(self):

# Show many areas
self.play(
OldLaggedStart(DrawBorderThenFill, blobs),
LaggedStartMap(DrawBorderThenFill, blobs),
Write(area_scale_words)
)
self.add_transformable_mobject(blobs)
Expand Down Expand Up @@ -1671,7 +1671,7 @@ def transform_space(self):
Animation(basis_vectors),
Animation(input_vect_mob),
Write(q_marks),
OldLaggedStart(FadeOut, blobs),
LaggedStartMap(FadeOut, blobs),
)
self.transformable_mobjects.remove(blobs)
self.play(
Expand Down Expand Up @@ -2005,7 +2005,7 @@ def construct(self):
coord_column[2].set_color(BLUE)
coord_column.generate_target()

self.play(OldLaggedStart(FadeIn, VGroup(
self.play(LaggedStartMap(FadeIn, VGroup(
z, equals, det_text, matrix.brackets,
VGroup(*matrix.mob_matrix[:, :2].flatten()),
coord_column
Expand Down
10 changes: 5 additions & 5 deletions active_projects/eola2/determinant_puzzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def add_example(self):
equation.set_width(FRAME_WIDTH - 2 * LARGE_BUFF)
equation.next_to(self.original_equation, DOWN, MED_LARGE_BUFF)

self.play(OldLaggedStart(FadeIn, equation))
self.play(LaggedStartMap(FadeIn, equation))

def compute_rhs(self):
M1, M2 = self.M1_copy, self.M2_copy
Expand Down Expand Up @@ -101,15 +101,15 @@ def compute_rhs(self):
for i, j in ((0, 0), (1, 1), (0, 1), (1, 0))
])
self.play(
OldLaggedStart(FadeIn, non_numbers, run_time=1),
OldLaggedStart(
LaggedStartMap(FadeIn, non_numbers, run_time=1),
LaggedStartMap(
ReplacementTransform,
matrix_numbers,
lambda m: (m, next(numbers_iter)),
path_arc=TAU / 6
),
)
self.play(OldLaggedStart(FadeIn, lines[1:], run_time=3))
self.play(LaggedStartMap(FadeIn, lines[1:], run_time=3))

def compute_lhs(self):
matrix = Matrix([[-3, 7], [0, 5]])
Expand Down Expand Up @@ -138,7 +138,7 @@ def compute_lhs(self):
ReplacementTransform(M.copy(), matrix)
for M in (self.M1, self.M2)
])
self.play(OldLaggedStart(FadeIn, group[1:]))
self.play(LaggedStartMap(FadeIn, group[1:]))
self.wait()


Expand Down
44 changes: 22 additions & 22 deletions active_projects/eop/bayes.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def add_cards(self):
card.generate_target()
card.scale(0.01)
card.move_to(deck[-1], UP+RIGHT)
self.play(OldLaggedStart(MoveToTarget, group, lag_ratio = 0.8))
self.play(LaggedStartMap(MoveToTarget, group, lag_ratio = 0.8))
self.wait()
self.wait()

Expand Down Expand Up @@ -90,13 +90,13 @@ def indicate_straight(self):
straight_cards.next_to(community_cards, UP, aligned_edge = LEFT)
you.hand.target.shift(MED_SMALL_BUFF*UP)

self.play(OldLaggedStart(
self.play(LaggedStartMap(
MoveToTarget,
selected_community_cards,
run_time = 1.5
))
self.play(MoveToTarget(you.hand))
self.play(OldLaggedStart(
self.play(LaggedStartMap(
ApplyMethod,
straight_cards,
lambda m : (m.set_color, YELLOW),
Expand Down Expand Up @@ -147,7 +147,7 @@ def show_flush_potential(self):
self.play(heart_cards.shift, heart_cards.get_height()*UP)
self.play(you.change_mode, "hesitant")
self.play(MoveToTarget(her.hand))
self.play(OldLaggedStart(DrawBorderThenFill, heart_qs))
self.play(LaggedStartMap(DrawBorderThenFill, heart_qs))
self.play(
her.change, "happy",
her.glasses.restore,
Expand Down Expand Up @@ -210,7 +210,7 @@ def compute_flush_probability(self):
color = BLUE, buff = SMALL_BUFF
)

self.play(OldLaggedStart(FadeIn, equation))
self.play(LaggedStartMap(FadeIn, equation))
self.wait(2)
self.play(
FadeIn(num_hearts),
Expand Down Expand Up @@ -305,7 +305,7 @@ def place_high_bet(self):
dollar.move_to(her.get_boundary_point(RIGHT))
dollar.set_fill(opacity = 0)

self.play(OldLaggedStart(
self.play(LaggedStartMap(
ApplyMethod,
money,
lambda m : (m.restore,),
Expand Down Expand Up @@ -480,7 +480,7 @@ def add_sample_space(self):
braces_and_labels = sample_space.get_side_braces_and_labels(labels)

self.play(
OldLaggedStart(FadeIn, sample_space),
LaggedStartMap(FadeIn, sample_space),
Write(braces_and_labels)
)
self.wait()
Expand Down Expand Up @@ -748,7 +748,7 @@ def write_P_flush_given_bet(self):
group.arrange(DOWN)
group.to_corner(UP+RIGHT)

self.play(OldLaggedStart(FadeIn, posterior_tex))
self.play(LaggedStartMap(FadeIn, posterior_tex))
self.play(Write(arrow))
self.play(MoveToTarget(rects[0]))
self.wait()
Expand Down Expand Up @@ -859,7 +859,7 @@ def tweak_non_flush_case(self):

self.wait(2)
self.play(*list(map(FadeIn, [her, her.glasses])))
self.play(OldLaggedStart(FadeIn, risk_averse_words))
self.play(LaggedStartMap(FadeIn, risk_averse_words))
self.play(her.change_mode, "sad", Animation(her.glasses))
self.wait()
self.play(ShowCreation(arrows))
Expand Down Expand Up @@ -1090,7 +1090,7 @@ def construct(self):

self.add(randy)
self.play(
OldLaggedStart(FadeIn, rule),
LaggedStartMap(FadeIn, rule),
randy.change, "erm", rule
)
self.play(Blink(randy))
Expand Down Expand Up @@ -1497,7 +1497,7 @@ def show_space_restriction(self):
post_rects = self.post_rects

self.play(non_I_rects.fade, 0.8)
self.play(OldLaggedStart(
self.play(LaggedStartMap(
ApplyMethod,
prior_rects,
lambda m : (m.set_color, YELLOW),
Expand Down Expand Up @@ -1608,13 +1608,13 @@ def add_prior(self):
word.scale(0.6)
word.move_to(part)

self.play(OldLaggedStart(FadeIn, sample_space, run_time = 1))
self.play(LaggedStartMap(FadeIn, sample_space, run_time = 1))
self.play(*list(map(GrowFromCenter, braces)))
for label in labels:
self.play(Write(label, run_time = 2))
self.wait()
for word, mode in zip(words, ["maybe", "soulful_musician"]):
self.play(OldLaggedStart(FadeIn, word, run_time = 1))
self.play(LaggedStartMap(FadeIn, word, run_time = 1))
self.change_pi_creature_with_guitar(mode)
self.wait()
self.wait()
Expand Down Expand Up @@ -1644,7 +1644,7 @@ def record_track(self):
Animation(friends)
)
self.play_notes(randy.guitar)
self.play(OldLaggedStart(
self.play(LaggedStartMap(
ApplyMethod, friends,
lambda pi : (pi.change, "hooray"),
run_time = 2,
Expand Down Expand Up @@ -1678,7 +1678,7 @@ def friend_gives_compliment(self):
VGroup(bubble, content).next_to(friends, LEFT, SMALL_BUFF)
VGroup(bubble, content).to_edge(UP, SMALL_BUFF)

self.play(OldLaggedStart(
self.play(LaggedStartMap(
ApplyMethod, friends,
lambda pi : (pi.change_mode, "conniving")
))
Expand All @@ -1687,7 +1687,7 @@ def friend_gives_compliment(self):
ShowCreation(bubble),
Write(bubble.content, run_time = 1),
ApplyMethod(friends[0].change_mode, "hooray"),
OldLaggedStart(
LaggedStartMap(
ApplyMethod, VGroup(*friends[1:]),
lambda pi : (pi.change_mode, "happy")
),
Expand All @@ -1704,7 +1704,7 @@ def friends_dont_like(self):
pi2.target.change("hesitant", pi1.eyes)
pi3.target.change("pondering", pi2.eyes)

self.play(OldLaggedStart(
self.play(LaggedStartMap(
MoveToTarget, friends
))
self.change_pi_creature_with_guitar("concerned_musician")
Expand Down Expand Up @@ -1751,7 +1751,7 @@ def get_positive_review(self):

self.change_pi_creature_with_guitar(
"soulful_musician",
OldLaggedStart(
LaggedStartMap(
ApplyMethod, friends,
lambda pi : (pi.change, "happy"),
run_time = 1,
Expand All @@ -1770,7 +1770,7 @@ def restrict_space(self):
negative_space.save_state()

self.play(negative_space.fade, 0.8)
self.play(OldLaggedStart(
self.play(LaggedStartMap(
ApplyMethod, positive_space,
lambda m : (m.set_color, YELLOW),
rate_func = there_and_back,
Expand Down Expand Up @@ -1909,7 +1909,7 @@ def intuition_of_positive_feedback(self):
self.play(ShowCreation(post_rect))
self.wait(2)
for mode, time in ("shruggie", 2), ("hesitant", 0):
self.play(OldLaggedStart(
self.play(LaggedStartMap(
ApplyMethod, friends,
lambda pi : (pi.change, mode),
run_time = 2,
Expand Down Expand Up @@ -1961,7 +1961,7 @@ def get_negative_feedback(self):
brace = braces[0]

self.play(old_prior_rects.fade, 0.8)
self.play(OldLaggedStart(
self.play(LaggedStartMap(
ApplyMethod, friends,
lambda pi : (pi.change, "pondering", post_rects),
run_time = 1
Expand Down Expand Up @@ -2058,7 +2058,7 @@ def play_notes(self, guitar):
notes.get_center() - \
sine_wave.point_from_proportion(0)
)
self.play(OldLaggedStart(
self.play(LaggedStartMap(
MoveAlongPath, notes,
lambda n : (n, sine_wave),
path_arc = np.pi/2,
Expand Down
Loading

0 comments on commit 1e2f41a

Please sign in to comment.