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

@ -139,10 +139,7 @@ class PutTogether3x3Matrix(Scene):
))
matrix.to_edge(DOWN)
start_entries = reduce(op.add, map(
lambda a : a.get_entries().split(),
arrays
))
start_entries = reduce(op.add, [a.get_entries().split() for a in arrays])
target_entries = matrix.get_mob_matrix().transpose().flatten()
start_l_bracket = i_array.get_brackets().split()[0]
start_r_bracket = k_array.get_brackets().split()[1]
@ -190,7 +187,7 @@ class ShowVCoordinateMeaning(Scene):
coords = Matrix(["x", "y", "z"])
eq2 = eq.copy()
if self.post_transform:
L, l_paren, r_paren = map(TexMobject, "L()")
L, l_paren, r_paren = list(map(TexMobject, "L()"))
parens = VMobject(l_paren, r_paren)
parens.scale(2)
parens.stretch_to_fit_height(
@ -199,11 +196,11 @@ class ShowVCoordinateMeaning(Scene):
VMobject(L, l_paren, coords, r_paren).arrange_submobjects(buff = 0.1)
coords.submobjects = [L, l_paren] + coords.submobjects + [r_paren]
lin_comb = VMobject(*map(TexMobject, [
lin_comb = VMobject(*list(map(TexMobject, [
"x", self.i_str, "+",
"y", self.j_str, "+",
"z", self.k_str,
]))
])))
lin_comb.arrange_submobjects(
RIGHT, buff = 0.1,
aligned_edge = ORIGIN if self.post_transform else DOWN
@ -223,7 +220,7 @@ class ShowVCoordinateMeaning(Scene):
if not self.post_transform:
lin_comb.shift(0.35*UP)
self.play(*map(Write, [v, eq, coords]))
self.play(*list(map(Write, [v, eq, coords])))
self.wait()
self.play(
Transform(
@ -259,7 +256,7 @@ class ShowMatrixVectorMultiplication(Scene):
for col in matrix.copy().get_mob_matrix().transpose()
]
coords = x, y, z = [m.copy() for m in vect.get_entries().split()]
eq, plus1, plus2 = map(TexMobject, list("=++"))
eq, plus1, plus2 = list(map(TexMobject, list("=++")))
everything = VMobject(
matrix, vect, eq,
x, col1, plus1,
@ -285,17 +282,17 @@ class ShowMatrixVectorMultiplication(Scene):
matrix_brace, vect_brace, result_brace = braces
self.play(*map(Write, [matrix, vect]), run_time = 2)
self.play(*list(map(Write, [matrix, vect])), run_time = 2)
self.play(Write(matrix_brace, run_time = 1))
self.play(Write(vect_brace, run_time = 1))
sexts = zip(
sexts = list(zip(
matrix.get_mob_matrix().transpose(),
columns,
vect.get_entries().split(),
coords,
[eq, plus1, plus2],
[X_COLOR, Y_COLOR, Z_COLOR]
)
))
for o_col, col, start_coord, coord, sym, color in sexts:
o_col = VMobject(*o_col)
self.play(
@ -386,12 +383,12 @@ class QuestionsToPonder(Scene):
title = TextMobject("Questions to ponder")
title.set_color(YELLOW).to_edge(UP)
self.add(title)
questions = VMobject(*map(TextMobject, [
questions = VMobject(*list(map(TextMobject, [
"1. Can you visualize these transformations?",
"2. Can you represent them with matrices?",
"3. How many rows and columns?",
"4. When can you multiply these matrices?",
]))
])))
questions.arrange_submobjects(DOWN, buff = 1, aligned_edge = LEFT)
questions.to_edge(LEFT)
for question in questions.split():