After running 2to3

This commit is contained in:
Grant Sanderson
2018-08-09 17:56:05 -07:00
parent 06a65190e7
commit 858051a806
172 changed files with 2117 additions and 2221 deletions

View File

@ -810,7 +810,7 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene):
self.pi_creature.change_mode, "happy"
)
self.wait()
self.play(*map(FadeOut, [trapezoid, strike]))
self.play(*list(map(FadeOut, [trapezoid, strike])))
self.unwrapped_ring = ring
@ -943,12 +943,12 @@ class GraphRectangles(CircleScene, GraphScene):
"x_min" : 0,
"x_max" : 4,
"x_axis_width" : 7,
"x_labeled_nums" : range(5),
"x_labeled_nums" : list(range(5)),
"x_axis_label" : "$r$",
"y_min" : 0,
"y_max" : 20,
"y_tick_frequency" : 2.5,
"y_labeled_nums" : range(5, 25, 5),
"y_labeled_nums" : list(range(5, 25, 5)),
"y_axis_label" : "",
"exclude_zero_label" : False,
"num_rings_in_ring_sum_start" : 3,
@ -1078,7 +1078,7 @@ class GraphRectangles(CircleScene, GraphScene):
self.wait()
self.play(FadeIn(dr_group))
self.wait()
self.play(*map(FadeOut, [moving_arrow, values_of_r]))
self.play(*list(map(FadeOut, [moving_arrow, values_of_r])))
self.x_axis.add(r_ticks)
self.r_ticks = r_ticks
@ -1132,7 +1132,7 @@ class GraphRectangles(CircleScene, GraphScene):
ring.target = target
ring.original_ring = ring.copy()
foreground_animations = map(Animation, [self.x_axis, self.area_label])
foreground_animations = list(map(Animation, [self.x_axis, self.area_label]))
example_ring = transformed_rings[2]
self.play(
@ -1240,7 +1240,7 @@ class GraphRectangles(CircleScene, GraphScene):
self.rects, self.flat_rects,
np.linspace(0, 0.5, len(self.rects))
)
] + map(Animation, [self.x_axis, self.graph])
] + list(map(Animation, [self.x_axis, self.graph]))
)
self.wait(2)
@ -1279,7 +1279,7 @@ class GraphRectangles(CircleScene, GraphScene):
for n in range(1, 5)
]
self.play(*map(FadeOut, [self.r_ticks, self.dr_group]))
self.play(*list(map(FadeOut, [self.r_ticks, self.dr_group])))
self.x_axis.remove(self.r_ticks, *self.r_ticks)
for new_rects in thinner_rects_list:
self.play(
@ -1339,11 +1339,11 @@ class GraphRectangles(CircleScene, GraphScene):
self.play(Write(formula.bottom_line))
self.wait(2)
self.play(*map(FadeOut, [
self.play(*list(map(FadeOut, [
self.ghost_rings,
self.ring_sum.tex_mobs
]))
self.play(*map(FadeIn, [fresh_rings, self.radius_group]))
])))
self.play(*list(map(FadeIn, [fresh_rings, self.radius_group])))
self.wait()
self.play(
Transform(formula, formula_with_R),
@ -1534,10 +1534,7 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene):
self.integral_condition = integral_condition
def show_sum(self):
visible_rings = filter(
lambda ring : ring.get_fill_opacity() > 0,
self.rings
)
visible_rings = [ring for ring in self.rings if ring.get_fill_opacity() > 0]
radii = self.dR*np.arange(len(visible_rings))
radii[-1] = 3-self.dR
@ -1656,13 +1653,13 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene):
self.play(
Write(self.y_axis, run_time = 2),
*map(FadeOut, [
*list(map(FadeOut, [
self.approximations,
self.area_label,
self.area_arrows,
self.dr_brace_group,
self.r_ticks,
])
]))
)
self.play(
ReplacementTransform(
@ -1952,11 +1949,11 @@ class MathematicianPonderingAreaUnderDifferentCurves(PiCreatureScene):
class AreaUnderParabola(GraphScene):
CONFIG = {
"x_max" : 4,
"x_labeled_nums" : range(-1, 5),
"x_labeled_nums" : list(range(-1, 5)),
"y_min" : 0,
"y_max" : 15,
"y_tick_frequency" : 2.5,
"y_labeled_nums" : range(5, 20, 5),
"y_labeled_nums" : list(range(5, 20, 5)),
"n_rect_iterations" : 6,
"default_right_x" : 3,
"func" : lambda x : x**2,
@ -2009,7 +2006,7 @@ class AreaUnderParabola(GraphScene):
rate_func = smooth,
submobject_mode = "lagged_start",
),
*map(Animation, foreground_mobjects)
*list(map(Animation, foreground_mobjects))
)
self.wait()
for new_rects in rect_lists[1:]:
@ -2018,7 +2015,7 @@ class AreaUnderParabola(GraphScene):
rects, new_rects,
submobject_mode = "lagged_start",
),
*map(Animation, foreground_mobjects)
*list(map(Animation, foreground_mobjects))
)
self.wait()
@ -2147,7 +2144,7 @@ class AreaUnderParabola(GraphScene):
group, update_group,
**kwargs
),
*map(Animation, self.foreground_mobjects)
*list(map(Animation, self.foreground_mobjects))
)
class WhoCaresAboutArea(TeacherStudentsScene):
@ -2226,7 +2223,7 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene):
self.move_right_point_to(curr_x + self.deriv_dx)
self.play(
FadeIn(shadow_rects),
*map(Animation, self.foreground_mobjects)
*list(map(Animation, self.foreground_mobjects))
)
self.shadow_rects = shadow_rects
@ -2279,7 +2276,7 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene):
self.play(
ReplacementTransform(dA_label[0].copy(), difference_in_area[0]),
ReplacementTransform(dA_label[1].copy(), difference_in_area[2]),
*map(FadeIn, [difference_in_area[1], difference_in_area[3]])
*list(map(FadeIn, [difference_in_area[1], difference_in_area[3]]))
)
self.wait(2)
self.play(FadeIn(dA_rect), Animation(dA_arrow))
@ -2334,10 +2331,10 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene):
self.play(Write(equation.get_part_by_tex("approx")))
self.wait()
for tex, mob in (f_tex, x_squared), ("dx", dx):
self.play(*map(Indicate, [
self.play(*list(map(Indicate, [
equation.get_part_by_tex(tex),
mob
]))
])))
self.wait(2)
self.play(*[
ReplacementTransform(
@ -2387,17 +2384,17 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene):
)
self.play(Blink(randy))
self.wait()
self.play(*map(FadeOut, [randy, q_marks, dA_circle]))
self.play(*list(map(FadeOut, [randy, q_marks, dA_circle])))
def write_example_inputs(self):
d = self.default_right_x
three = TexMobject("x =", "%d"%d)
three_plus_dx = TexMobject("x = ", "%d.001"%d)
labels_lines_vects = zip(
labels_lines_vects = list(zip(
[three, three_plus_dx],
self.right_v_lines,
[LEFT, RIGHT]
)
))
for label, line, vect in labels_lines_vects:
point = line.get_bottom()
@ -2568,7 +2565,7 @@ class AlternateAreaUnderCurve(PlayingTowardsDADX):
)
dx_to_zero = self.dx_to_zero_words[1]
self.play(*map(FadeIn, [box, brace]))
self.play(*list(map(FadeIn, [box, brace])))
self.wait()
self.play(
FadeOut(faders),