Video work (#1739)

* Enable setting points to a null list, and adding one point at a time.

* Add refresh_locked_data

* Add presenter mode to scenes with -p option

* Allow for an embed by hitting e during interaction

* Add set_min_height, etc.

* Make sure null parametric curve has at least one point

* Account for edge case where \{ is used in Tex

* Allow for logging notes in wait calls, useful for presenter mode

* Simplify choose, and add gen_choose for fractional amounts

* Default to no top on axes

* Allow match_x, match_y, etc. to take in a point

* Allow wait calls to ignore presenter mode

* Just use math.combo, no caching with choose(n, r)

* Use generator instead of list in bezier

* Bubble init_colors should override

* Account for "px" values read in from an svg

* Stop displaying when writing is happening

* Update the way Bubble override SVG colors
This commit is contained in:
Grant Sanderson
2022-02-13 15:16:16 -08:00
committed by GitHub
parent f9351536e4
commit 602809758e
12 changed files with 115 additions and 51 deletions

View File

@ -1,6 +1,6 @@
import inspect
import numpy as np
from scipy import special
import math
from functools import lru_cache
@ -10,7 +10,11 @@ def sigmoid(x):
@lru_cache(maxsize=10)
def choose(n, k):
return special.comb(n, k, exact=True)
return math.comb(n, k)
def gen_choose(n, r):
return np.prod(np.arange(n, n - r, -1)) / math.factorial(r)
def get_num_args(function):