Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

fixed imports in new EoP structure

Ben Hambrecht5f73509264a0
diff --git a/active_projects/eop/chapter0/__init__.py b/active_projects/eop/chapter0/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/active_projects/eop/chapter1/__init__.py b/active_projects/eop/chapter1/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/active_projects/eop/chapter1/area_model_bayes.py b/active_projects/eop/chapter1/area_model_bayes.py
index a7de457c4..1dae8d352 100644
--- a/active_projects/eop/chapter1/area_model_bayes.py
+++ b/active_projects/eop/chapter1/area_model_bayes.py
@@ -1,5 +1,4 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
class IllustrateAreaModelBayes(Scene):
diff --git a/active_projects/eop/chapter1/area_model_erf.py b/active_projects/eop/chapter1/area_model_erf.py
index b526c8f61..cb9783600 100644
--- a/active_projects/eop/chapter1/area_model_erf.py
+++ b/active_projects/eop/chapter1/area_model_erf.py
@@ -1,6 +1,5 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
from old_projects.eoc.chapter8 import *
import scipy.special
diff --git a/active_projects/eop/chapter1/area_model_expectation.py b/active_projects/eop/chapter1/area_model_expectation.py
index 5cd691807..653e979fc 100644
--- a/active_projects/eop/chapter1/area_model_expectation.py
+++ b/active_projects/eop/chapter1/area_model_expectation.py
@@ -1,6 +1,6 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
class IllustrateAreaModelExpectation(Scene):
diff --git a/active_projects/eop/chapter1/brick_row_scene.py b/active_projects/eop/chapter1/brick_row_scene.py
index 13c3091c7..f1237159b 100644
--- a/active_projects/eop/chapter1/brick_row_scene.py
+++ b/active_projects/eop/chapter1/brick_row_scene.py
@@ -1,5 +1,5 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
class BrickRowScene(PiCreatureScene):
diff --git a/active_projects/eop/chapter1/entire_brick_wall.py b/active_projects/eop/chapter1/entire_brick_wall.py
index 80b9c4168..31d07ec1e 100644
--- a/active_projects/eop/chapter1/entire_brick_wall.py
+++ b/active_projects/eop/chapter1/entire_brick_wall.py
@@ -1,6 +1,6 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
class EntireBrickWall(Scene):
diff --git a/active_projects/eop/chapter1/intro.py b/active_projects/eop/chapter1/intro.py
index 3247bf459..39a924d3c 100644
--- a/active_projects/eop/chapter1/intro.py
+++ b/active_projects/eop/chapter1/intro.py
@@ -1,5 +1,5 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
class Chapter1OpeningQuote(OpeningQuote):
CONFIG = {
diff --git a/active_projects/eop/chapter1/just_randy_flipping_coin.py b/active_projects/eop/chapter1/just_randy_flipping_coin.py
index 235f846c7..abc95ef43 100644
--- a/active_projects/eop/chapter1/just_randy_flipping_coin.py
+++ b/active_projects/eop/chapter1/just_randy_flipping_coin.py
@@ -1,12 +1,12 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
class JustFlipping(Scene):
def construct(self):
- randy = CoinFlippingPiCreature().shift(2 * DOWN)
+ randy = CoinFlippingPiCreature(color = MAROON_E, flip_height = 1).shift(2 * DOWN)
self.add(randy)
self.wait(2)
@@ -21,7 +21,7 @@ class JustFlippingWithResults(Scene):
def construct(self):
- randy = CoinFlippingPiCreature().shift(2 * DOWN)
+ randy = CoinFlippingPiCreature(color = MAROON_E, flip_height = 1).shift(2 * DOWN)
self.add(randy)
self.wait(2)
diff --git a/active_projects/eop/chapter1/morph_brick_row_into_histogram.py b/active_projects/eop/chapter1/morph_brick_row_into_histogram.py
index c2613a600..7294e9e8f 100644
--- a/active_projects/eop/chapter1/morph_brick_row_into_histogram.py
+++ b/active_projects/eop/chapter1/morph_brick_row_into_histogram.py
@@ -1,6 +1,6 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
class GenericMorphBrickRowIntoHistogram(Scene):
diff --git a/active_projects/eop/chapter1/quiz_result.py b/active_projects/eop/chapter1/quiz_result.py
index 8ad7de169..f03700c1f 100644
--- a/active_projects/eop/chapter1/quiz_result.py
+++ b/active_projects/eop/chapter1/quiz_result.py
@@ -1,7 +1,8 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
+from active_projects.eop.independence import *
class QuizResult(Scene):
diff --git a/active_projects/eop/chapter1/show_uncertainty_darts.py b/active_projects/eop/chapter1/show_uncertainty_darts.py
index 4806e6c2a..d206069a0 100644
--- a/active_projects/eop/chapter1/show_uncertainty_darts.py
+++ b/active_projects/eop/chapter1/show_uncertainty_darts.py
@@ -1,8 +1,8 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
-class ShowUncertainty2(Scene):
+class ShowUncertaintyDarts(Scene):
def throw_darts(self, n, run_time = 1):
diff --git a/active_projects/eop/chapter1/show_uncertainty_dice.py b/active_projects/eop/chapter1/show_uncertainty_dice.py
index 22040b839..eafa17537 100644
--- a/active_projects/eop/chapter1/show_uncertainty_dice.py
+++ b/active_projects/eop/chapter1/show_uncertainty_dice.py
@@ -1,5 +1,5 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
class ShowUncertaintyDice(Scene):
diff --git a/active_projects/eop/chapter1/show_uncertainty_disease.py b/active_projects/eop/chapter1/show_uncertainty_disease.py
index d0933e3e5..db5b71ad7 100644
--- a/active_projects/eop/chapter1/show_uncertainty_disease.py
+++ b/active_projects/eop/chapter1/show_uncertainty_disease.py
@@ -1,5 +1,5 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
diff --git a/active_projects/eop/chapter1/various_intro_visuals.py b/active_projects/eop/chapter1/various_intro_visuals.py
index 0c64154b4..6e7151f23 100644
--- a/active_projects/eop/chapter1/various_intro_visuals.py
+++ b/active_projects/eop/chapter1/various_intro_visuals.py
@@ -1,5 +1,7 @@
from big_ol_pile_of_manim_imports import *
-from active_projects.eop.reusables import *
+from active_projects.eop.reusable_imports import *
+from active_projects.eop.combinations import *
+from active_projects.eop.independence import *
import itertools as it
diff --git a/active_projects/eop/chapter2/__init__.py b/active_projects/eop/chapter2/__init__.py
new file mode 100644
index 000000000..e69de29bb
diff --git a/active_projects/eop/reusable_imports.py b/active_projects/eop/reusable_imports.py
new file mode 100644
index 000000000..7dcafd433
--- /dev/null
+++ b/active_projects/eop/reusable_imports.py
@@ -0,0 +1,11 @@
+from active_projects.eop.reusables.binary_option import *
+from active_projects.eop.reusables.brick_row import *
+from active_projects.eop.reusables.coin_flip_tree import *
+from active_projects.eop.reusables.coin_flipping_pi_creature import *
+from active_projects.eop.reusables.coin_stacks import *
+from active_projects.eop.reusables.dice import *
+from active_projects.eop.reusables.eop_constants import *
+from active_projects.eop.reusables.eop_helpers import *
+from active_projects.eop.reusables.histograms import *
+from active_projects.eop.reusables.sick_pi_creature import *
+from active_projects.eop.reusables.upright_coins import *
diff --git a/active_projects/eop/reusables/binary_option.py b/active_projects/eop/reusables/binary_option.py
index 2fdb58ea1..ed0c3f450 100644
--- a/active_projects/eop/reusables/binary_option.py
+++ b/active_projects/eop/reusables/binary_option.py
@@ -1,4 +1,5 @@
from mobject.types.vectorized_mobject import *
+from mobject.svg.tex_mobject import *
class BinaryOption(VMobject):
diff --git a/active_projects/eop/reusables/coin_flipping_pi_creature.py b/active_projects/eop/reusables/coin_flipping_pi_creature.py
index c94c4ac13..20475532d 100644
--- a/active_projects/eop/reusables/coin_flipping_pi_creature.py
+++ b/active_projects/eop/reusables/coin_flipping_pi_creature.py
@@ -6,7 +6,7 @@ from utils.rate_functions import *
from for_3b1b_videos.pi_creature_scene import *
from active_projects.eop.reusables.eop_helpers import *
from active_projects.eop.reusables.eop_constants import *
-
+from active_projects.eop.reusables.coin_flipping_pi_creature import *
class PiCreatureCoin(VMobject):
@@ -46,6 +46,9 @@ class PiCreatureCoin(VMobject):
self.add(ridge)
class CoinFlippingPiCreature(PiCreature):
+ CONFIG = {
+ "flip_height": 3
+ }
def __init__(self, mode = "coin_flip_1", **kwargs):
@@ -93,6 +96,7 @@ class FlipCoin(AnimationGroup):
pi_creature.coin,
vector = UP,
nb_turns = 5,
+ height = pi_creature.flip_height * pi_creature.get_height(),
rate_func = self.coin_rate_func,
**kwargs
)
diff --git a/active_projects/eop/reusables/histograms.py b/active_projects/eop/reusables/histograms.py
index 8bb62d78d..dc1e1b2c2 100644
--- a/active_projects/eop/reusables/histograms.py
+++ b/active_projects/eop/reusables/histograms.py
@@ -282,8 +282,8 @@ class FlashThroughHistogram(Animation):
class OutlineableBars(VGroup):
- # A group of bars (rectangles), together with
- # a method that draws an outline around them,
+ # A group of bars (rectangles), together with
+ # a method that draws an outline around them,
# assuming the bars are arranged in a histogram
# (aligned at the bottom without gaps).
diff --git a/active_projects/eop/reusables/sick_pi_creature.py b/active_projects/eop/reusables/sick_pi_creature.py
index e6d9469e6..3b754e19e 100644
--- a/active_projects/eop/reusables/sick_pi_creature.py
+++ b/active_projects/eop/reusables/sick_pi_creature.py
@@ -1,6 +1,6 @@
from for_3b1b_videos.pi_creature import *
-from active_projects.eop.reusables.constants import *
+from active_projects.eop.reusables.eop_constants import *
class SicklyPiCreature(PiCreature):