Skip to content

Commit

Permalink
Typo fix: make_number_changable -> make_number_changeable
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Mar 21, 2024
1 parent b353a3b commit f7ce17b
Show file tree
Hide file tree
Showing 21 changed files with 55 additions and 55 deletions.
4 changes: 2 additions & 2 deletions _2023/clt/dice_sims.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def add_sample_label(self):
label = TexText(R"\# Sums = 0", font_size=36)
label.set_fill(GREY_B)
label.to_edge(LEFT)
label.count = label.make_number_changable("0")
label.count = label.make_number_changeable("0")
label.count.edge_to_fix = LEFT

self.add(label)
Expand Down Expand Up @@ -148,7 +148,7 @@ def get_sum():

# Sum label
sum_label = TexText(f"Sum = 0")
sum_label.count = sum_label.make_number_changable(0)
sum_label.count = sum_label.make_number_changeable(0)
sum_label.next_to(dice, DOWN, buff=MED_LARGE_BUFF)
sum_label.count.set_value(get_sum())

Expand Down
18 changes: 9 additions & 9 deletions _2023/clt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def construct(self):
prob_labels = VGroup()
for column in columns:
label = Tex("1 / 36")
numer = label.make_number_changable("1")
numer = label.make_number_changeable("1")
numer.edge_to_fix = RIGHT
numer.set_value(len(column))
label.next_to(column, UP, SMALL_BUFF)
Expand Down Expand Up @@ -510,7 +510,7 @@ def get_plot_label(self, plot, n, die_face=False, height=0.35):
terms = die.replicate(min(n, 5))
else:
term = Tex("X_0")
term.make_number_changable("0")
term.make_number_changeable("0")
terms = term.replicate(min(n, 5))
for i, term in enumerate(terms):
term[1].set_value(i + 1)
Expand Down Expand Up @@ -1200,7 +1200,7 @@ def get_sigma():
mean_line.set_stroke(PINK, 3)
mean_line.add_updater(lambda m: m.move_to(axes.c2p(get_mu() - 0.5, 0), DOWN))
mu_label = Tex(R"\mu = 1.00", **tex_kw)
mu_number = mu_label.make_number_changable("1.00")
mu_number = mu_label.make_number_changeable("1.00")
mu_number.add_updater(lambda m: m.set_value(get_mu()))
mu_number.scale(0.75, about_edge=LEFT)
mu_label.add_updater(lambda m: m.next_to(mean_line, UP))
Expand Down Expand Up @@ -1635,7 +1635,7 @@ def decay_anim(graph):

alt_base_form = Tex(R"=(2.718)^{-x^2}", **kw)
alt_base_form.next_to(rhs, RIGHT)
base = alt_base_form.make_number_changable("2.718")
base = alt_base_form.make_number_changeable("2.718")
base_width = base.get_width()
base.set_color(TEAL)
base.edge_to_fix = ORIGIN
Expand Down Expand Up @@ -2031,7 +2031,7 @@ def update_area(area):

def get_variable_display(self, name, color, value_range):
eq = Tex(f"{name} = 1.00", t2c={name: color})
number = eq.make_number_changable("1.00")
number = eq.make_number_changeable("1.00")

tracker = ValueTracker(1)
get_value = tracker.get_value
Expand Down Expand Up @@ -2659,7 +2659,7 @@ def get_sum_label(self, n: str | int, dots=True, scaled: bool = False):
sum_label.scale(0.8)

if isinstance(n, int) and n_str in sum_label.get_string():
n_parts = sum_label.make_number_changable(n_str, replace_all=True)
n_parts = sum_label.make_number_changeable(n_str, replace_all=True)
for part in n_parts:
part.set_value(n)

Expand Down Expand Up @@ -2773,7 +2773,7 @@ def get_mean_sd_labels(self, mu_tex, sigma_tex, mean, sd):
values = [mean, sd]
colors = [PINK, RED]
for label, value, color in zip(labels, values, colors):
num = label.make_number_changable("0.00")
num = label.make_number_changeable("0.00")
num.set_value(value)
num.set_color(color)

Expand Down Expand Up @@ -3038,7 +3038,7 @@ def construct(self):
old_plot = VGroup()

var_label = Tex(R"\text{Var}(X) = 0.00", font_size=60)
var_label.make_number_changable("0.00")
var_label.make_number_changeable("0.00")
var_label.move_to(2 * UP)
var_label["X"].set_color(BLUE)
self.add(var_label)
Expand Down Expand Up @@ -3159,7 +3159,7 @@ def update_area(area, dx=0.01):
# Area decimal
area_label = TexText("Area = 0.000", font_size=40)
area_label.set_backstroke(width=8)
num = area_label.make_number_changable("0.000")
num = area_label.make_number_changeable("0.000")
from scipy.stats import norm

def get_area():
Expand Down
6 changes: 3 additions & 3 deletions _2023/clt/wordy_scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def construct(self):

sum_label = TexText("Sum = 100")
sum_label.next_to(dice, UP)
num = sum_label.make_number_changable("100")
num = sum_label.make_number_changeable("100")
n_tracker = ValueTracker(0)
num.add_updater(lambda m: m.set_value(sum(die_values[:int(n_tracker.get_value())])))

Expand Down Expand Up @@ -978,7 +978,7 @@ def get_dice():

sum_label = TexText("Sum = 100", font_size=60)
sum_label.next_to(dice, RIGHT, buff=LARGE_BUFF)
num = sum_label.make_number_changable("100")
num = sum_label.make_number_changeable("100")
num.add_updater(lambda m: m.set_value(sum(
die.value for die in dice
)))
Expand Down Expand Up @@ -1013,7 +1013,7 @@ class AverageDiceValues(InteractiveScene):
def construct(self):
# Test
avg_label = TexText("Average value = 0.00")
avg_label.make_number_changable("0.00")
avg_label.make_number_changeable("0.00")
avg_label.next_to(ORIGIN, RIGHT)
avg_label.set_y(FRAME_HEIGHT / 4)
self.add(avg_label)
Expand Down
2 changes: 1 addition & 1 deletion _2023/clt_proof/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def get_exp_graph():
)
graph_label.arrange(DOWN, buff=MED_LARGE_BUFF, aligned_edge=LEFT)
graph_label.to_corner(UR).shift(3 * LEFT)
value = graph_label[1].make_number_changable("1.00")
value = graph_label[1].make_number_changeable("1.00")
value.add_updater(lambda m: m.set_value(get_t()))

self.add(axes)
Expand Down
2 changes: 1 addition & 1 deletion _2023/convolutions2/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def get_normal_parameter_labels(self, plot, mean, sigma, font_size=18, color=GRE
Tex(R"\text{Std. Dev.} = 0.0", **kw),
)
for label, value in zip(labels, [mean, sigma]):
number = label.make_number_changable("0.0")
number = label.make_number_changeable("0.0")
number.set_value(value)

labels.arrange(DOWN, aligned_edge=LEFT)
Expand Down
2 changes: 1 addition & 1 deletion _2023/convolutions2/diagonal_slices.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def init_func_name(self):

def init_line_labels(self, get_s):
equation = Tex("x + y = 0.00")
s_label = equation.make_number_changable("0.00")
s_label = equation.make_number_changeable("0.00")
s_label.add_updater(lambda m: m.set_value(get_s()))
equation.to_corner(UR)
equation.fix_in_frame()
Expand Down
4 changes: 2 additions & 2 deletions _2023/convolutions2/dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,12 @@ def get_p_label(dice):
prod_rhs = Tex("= (0.00)(0.00)")
num_rhs = Tex("= 0.000")

value1, value2 = prod_rhs.make_number_changable("0.00", replace_all=True)
value1, value2 = prod_rhs.make_number_changeable("0.00", replace_all=True)
value1.set_value(dist1[i0 - 1]).set_color(BLUE)
value2.set_value(dist2[j0 - 1]).set_color(RED)
prod_rhs.next_to(p_label[1], DOWN, MED_LARGE_BUFF, aligned_edge=LEFT)

pair_prob = num_rhs.make_number_changable("0.000")
pair_prob = num_rhs.make_number_changeable("0.000")
pair_prob.set_value(dist1[i0 - 1] * dist2[j0 - 1])
num_rhs.next_to(prod_rhs, DOWN, MED_LARGE_BUFF, aligned_edge=LEFT)

Expand Down
10 changes: 5 additions & 5 deletions _2023/gauss_int/herschel.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,8 @@ def construct(self):
class VariableInputs(InteractiveScene):
def construct(self):
equation = Tex(R"f(\sqrt{(1.00)^2 + (0.00)^2}) = f(1.00)f(0.00)")
xs = equation.make_number_changable("1.00", replace_all=True)
ys = equation.make_number_changable("0.00", replace_all=True)
xs = equation.make_number_changeable("1.00", replace_all=True)
ys = equation.make_number_changeable("0.00", replace_all=True)

xs.set_color(BLUE)
ys.set_color(YELLOW)
Expand Down Expand Up @@ -448,8 +448,8 @@ def construct(self):
line_groups = VGroup(*(VGroup() for n in range(max_n - 2)))
labels = VGroup()
frac_template = Tex(R"1 \over 2")
frac_template.make_number_changable("1")
frac_template.make_number_changable("2")
frac_template.make_number_changeable("1")
frac_template.make_number_changeable("2")

for pair in pairs:
k, n = pair
Expand Down Expand Up @@ -1131,7 +1131,7 @@ def get_c_group(self):
c_tip.add_updater(lambda m: m.move_to(c_interval.n2p(get_c()), DOWN))

c_label = Tex("c = 1.00", t2c={"c": RED}, font_size=36)
c_label.make_number_changable("1.00")
c_label.make_number_changeable("1.00")
c_label[-1].scale(0.8, about_edge=LEFT)
c_label.add_updater(lambda m: m[-1].set_value(get_c()))
c_label.add_updater(lambda m: m.next_to(c_tip, UP, aligned_edge=LEFT))
Expand Down
4 changes: 2 additions & 2 deletions _2023/gauss_int/integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ def get_x_slices(dx=0.25):
)
get_y = y_tracker.get_value
x_slice_label = Tex("0.00 e^{-x^2}", **tex_kw)
coef = x_slice_label.make_number_changable("0.00")
coef = x_slice_label.make_number_changeable("0.00")
coef.set_color(YELLOW)
coef.add_updater(lambda m: m.set_value(math.exp(-get_y()**2)).rotate(90 * DEGREES, RIGHT))

Expand Down Expand Up @@ -1148,7 +1148,7 @@ def get_x_slices(dx=0.25):
def get_area_label():
area_label = TexText(R"Area = $0.00 \cdot C$", font_size=30)
area_label["C"].set_color(RED)
num = area_label.make_number_changable("0.00")
num = area_label.make_number_changeable("0.00")
num.set_value(coef.get_value())
area_label.rotate(90 * DEGREES, RIGHT)
area_label.move_to(interpolate(x_slice.get_zenith(), x_slice.get_nadir(), 0.66))
Expand Down
8 changes: 4 additions & 4 deletions _2023/moser_reboot/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def construct(self):

for i, j in it.combinations(indices, 2):
label = pair_label_template.copy()
values = label.make_number_changable("0", replace_all=True)
values = label.make_number_changeable("0", replace_all=True)
values[0].set_value(i + 1)
values[1].set_value(j + 1)
label.next_to(last_label, DOWN)
Expand Down Expand Up @@ -222,7 +222,7 @@ def construct(self):
for pair in pair_labels
))
rhs = Tex("= 0")
rhs_num = rhs.make_number_changable("0")
rhs_num = rhs.make_number_changeable("0")
rhs.next_to(nc2, RIGHT)

nc2[1].set_opacity(0)
Expand Down Expand Up @@ -484,7 +484,7 @@ def construct(self):

# Show the count
rhs = Tex("= 0")
rhs_num = rhs.make_number_changable("0")
rhs_num = rhs.make_number_changeable("0")
rhs.next_to(nc4, RIGHT)

quad_rects = VGroup(*(
Expand Down Expand Up @@ -539,7 +539,7 @@ def show_quadruplets(self, diagram, quad_words):

for sub_indices in it.combinations(indices, 4):
label = quad_label_template.copy()
values = label.make_number_changable("0", replace_all=True)
values = label.make_number_changeable("0", replace_all=True)
for value, i in zip(values, sub_indices):
value.set_value(i + 1)
label.next_to(last_label, DOWN)
Expand Down
6 changes: 3 additions & 3 deletions _2023/optics_puzzles/adding_waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ def construct(self):
# Show lower function label
sum_sine = Tex(R"= 1.00\sin(\omega t +2.00)", t2c={R"\omega": GOLD}, font_size=36)
sum_sine.next_to(wave3_label, RIGHT, SMALL_BUFF)
sum_A = sum_sine.make_number_changable("1.00")
sum_phi = sum_sine.make_number_changable("+2.00", include_sign=True)
sum_A = sum_sine.make_number_changeable("1.00")
sum_phi = sum_sine.make_number_changeable("+2.00", include_sign=True)
sum_A.set_color(RED)
sum_phi.set_color(PINK)
sum_parameters = VGroup(sum_A, sum_phi)
Expand Down Expand Up @@ -581,7 +581,7 @@ def func(x):
labels.next_to(axes, LEFT, MED_LARGE_BUFF)
for label, tracker in zip(labels, trackers):
label.tracker = tracker
label.value = label.make_number_changable("1.00")
label.value = label.make_number_changeable("1.00")
label.add_updater(lambda m: m.value.set_value(m.tracker.get_value()))

name_label = Tex(
Expand Down
4 changes: 2 additions & 2 deletions _2023/optics_puzzles/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,8 @@ def construct(self):

def get_cos_tex():
cos_tex = Tex(R"\cos(10^\circ) = 0.00", font_size=36)
cos_tex.make_number_changable("10", edge_to_fix=RIGHT).set_value(line.get_angle() / DEGREES)
cos_tex.make_number_changable("0.00").set_value(math.cos(line.get_angle()))
cos_tex.make_number_changeable("10", edge_to_fix=RIGHT).set_value(line.get_angle() / DEGREES)
cos_tex.make_number_changeable("0.00").set_value(math.cos(line.get_angle()))
cos_tex.rotate(line.get_angle())
cos_tex.move_to(weak_words[-len(cos_temp_text) + 1:])
cos_tex.set_backstroke(BLACK, 10)
Expand Down
4 changes: 2 additions & 2 deletions _2023/optics_puzzles/cylinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def get_slice_plane(self, axes, get_x):
def get_plane_label(self, axes, plane, font_size=24, color=GREY_B):
x_label = Tex("x = 0.00", font_size=font_size)
x_label.set_fill(color)
x_label.value_mob = x_label.make_number_changable("0.00")
x_label.value_mob = x_label.make_number_changeable("0.00")
x_label.rotate(PI / 2, RIGHT)
x_label.rotate(PI / 2, IN)

Expand Down Expand Up @@ -1298,7 +1298,7 @@ def slow_down():
rot_label.set_height(0.2)
rot_label.set_color(GREY_B)
rot_label.next_to(plane, UP)
dec = rot_label.make_number_changable("0.00", edge_to_fix=LEFT)
dec = rot_label.make_number_changeable("0.00", edge_to_fix=LEFT)
dec.phase_tracker = tracker
dec.add_updater(lambda m: m.set_value(m.phase_tracker.get_value() / TAU))

Expand Down
4 changes: 2 additions & 2 deletions _2023/optics_puzzles/e_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def place_force_word_on_arrow(word, arrow):
d_label = Tex("r = 0.00", font_size=36)
d_label.next_to(d_line, DOWN, buff=0.35)
d_label.add_updater(lambda m: m.match_x(d_line))
dist_decimal = d_label.make_number_changable("0.00")
dist_decimal = d_label.make_number_changeable("0.00")

def get_d():
return get_norm(charges[0].get_center() - charges[1].get_center())
Expand Down Expand Up @@ -423,7 +423,7 @@ def get_d():

time_label = Tex("t = 0.00")
time_label.to_corner(UL)
time_decimal = time_label.make_number_changable("0.00")
time_decimal = time_label.make_number_changeable("0.00")
time_decimal.add_updater(lambda m: m.set_value(ring.time))

start_point = charges[0].get_center().copy()
Expand Down
8 changes: 4 additions & 4 deletions _2023/optics_puzzles/slowing_waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def construct(self):
# Show the phase kick
form1 = Tex(R"A\sin(kx)")
form2 = Tex(R"A\sin(kx + 1.00)")
pk_decimal: DecimalNumber = form2.make_number_changable("1.00")
pk_decimal: DecimalNumber = form2.make_number_changeable("1.00")
pk_decimal.set_value(-phase_kick)
pk_decimal.set_color(RED)

Expand Down Expand Up @@ -445,7 +445,7 @@ def construct(self):
n_layers_label = TexText(f"Num. layers = {n_shown_layers}", font_size=36)
n_layers_label.set_color(GREY_B)
n_layers_label.next_to(pk_label, UP, MED_LARGE_BUFF, LEFT)
nl_decimal = n_layers_label.make_number_changable(n_shown_layers)
nl_decimal = n_layers_label.make_number_changeable(n_shown_layers)
nl_decimal.set_color(BLUE)

self.play(FadeIn(n_layers_label, UP))
Expand Down Expand Up @@ -629,7 +629,7 @@ def get_index():
}
)
equation.next_to(layers, UP)
rhs = equation.make_number_changable("1.00")
rhs = equation.make_number_changeable("1.00")

rhs.add_updater(lambda m: m.set_value(get_index()))

Expand All @@ -640,7 +640,7 @@ def get_index():

# Speed label
speed_label = Tex(R"\text{Speed} = c / 1.00")
speed_factor = speed_label.make_number_changable("1.00")
speed_factor = speed_label.make_number_changeable("1.00")
speed_factor.add_updater(lambda m: m.set_value(get_index()))
speed_label.next_to(layers.get_bottom(), UP)

Expand Down
8 changes: 4 additions & 4 deletions _2023/optics_puzzles/slowing_waves_insert_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def construct(self):
# Show the phase kick
form1 = Tex(R"A\sin(kx)")
form2 = Tex(R"A\sin(kx + 1.00)")
pk_decimal: DecimalNumber = form2.make_number_changable("1.00")
pk_decimal: DecimalNumber = form2.make_number_changeable("1.00")
pk_decimal.set_value(-phase_kick)
pk_decimal.set_color(RED)

Expand Down Expand Up @@ -445,7 +445,7 @@ def construct(self):
n_layers_label = TexText(f"Num. layers = {n_shown_layers}", font_size=36)
n_layers_label.set_color(GREY_B)
n_layers_label.next_to(pk_label, UP, MED_LARGE_BUFF, LEFT)
nl_decimal = n_layers_label.make_number_changable(n_shown_layers)
nl_decimal = n_layers_label.make_number_changeable(n_shown_layers)
nl_decimal.set_color(BLUE)

self.play(FadeIn(n_layers_label, UP))
Expand Down Expand Up @@ -629,7 +629,7 @@ def get_index():
}
)
equation.next_to(layers, UP)
rhs = equation.make_number_changable("1.00")
rhs = equation.make_number_changeable("1.00")

rhs.add_updater(lambda m: m.set_value(get_index()))

Expand All @@ -640,7 +640,7 @@ def get_index():

# Speed label
speed_label = Tex(R"\text{Speed} = c / 1.00")
speed_factor = speed_label.make_number_changable("1.00")
speed_factor = speed_label.make_number_changeable("1.00")
speed_factor.add_updater(lambda m: m.set_value(get_index()))
speed_label.next_to(layers.get_bottom(), UP)

Expand Down
Loading

0 comments on commit f7ce17b

Please sign in to comment.