Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Add deprecation warning for FadeOutAndShiftDown and FadeInFromDown (issue#112)

Philipp Imhof3ec7b41f2c2f
diff --git a/manim/animation/fading.py b/manim/animation/fading.py
index 74edf5a3f..8d0ade091 100644
--- a/manim/animation/fading.py
+++ b/manim/animation/fading.py
@@ -5,6 +5,7 @@ from ..constants import DOWN
from ..mobject.types.vectorized_mobject import VMobject
from ..utils.bezier import interpolate
from ..utils.rate_functions import there_and_back
+from ..logger import logger
DEFAULT_FADE_LAG_RATIO = 0
@@ -71,6 +72,10 @@ class FadeInFromDown(FadeInFrom):
"lag_ratio": DEFAULT_ANIMATION_LAG_RATIO,
}
+ def __init__(self, mobject, **kwargs):
+ super().__init__(mobject, direction=DOWN, **kwargs)
+ logger.warning("FadeInFromDown is deprecated and will eventually disappear. Please use FadeInFrom(<mobject>, direction=DOWN, <other_args>) instead.")
+
class FadeOutAndShift(FadeOut):
CONFIG = {
@@ -97,6 +102,10 @@ class FadeOutAndShiftDown(FadeOutAndShift):
"direction": DOWN,
}
+ def __init__(self, mobject, **kwargs):
+ super().__init__(mobject, direction=DOWN, **kwargs)
+ logger.warning("FadeOutAndShiftDown is deprecated and will eventually disappear. Please use FadeOutAndShift(<mobject>, direction=DOWN, <other_args>) instead.")
+
class FadeInFromPoint(FadeIn):
def __init__(self, mobject, point, **kwargs):
@@ -156,4 +165,4 @@ class VFadeInThenOut(VFadeIn):
CONFIG = {
"rate_func": there_and_back,
"remover": True,
- }
\ No newline at end of file
+ }