@@ -548,7 +548,7 @@ def show_ghost_movement(self, vector: Arrow | list | tuple | np.ndarray) -> None
548
548
# TODO:
549
549
# I think that this should be a VGroup instead of a VMobject.
550
550
dots = VMobject (
551
- * (
551
+ * ( # type: ignore[arg-type]
552
552
Dot (x * RIGHT + y * UP )
553
553
for x in range (- x_max , x_max )
554
554
for y in range (- y_max , y_max )
@@ -676,7 +676,7 @@ def setup(self) -> None:
676
676
self .background_mobjects : list [Mobject ] = []
677
677
self .foreground_mobjects : list [Mobject ] = []
678
678
self .transformable_mobjects : list [Mobject ] = []
679
- self .moving_vectors : list [VGroup ] = []
679
+ self .moving_vectors : list [Mobject ] = []
680
680
self .transformable_labels : list [MathTex ] = []
681
681
self .moving_mobjects : list [Mobject ] = []
682
682
@@ -854,6 +854,7 @@ def add_vector(
854
854
self ,
855
855
vector : Arrow | list | tuple | np .ndarray ,
856
856
color : ParsableManimColor = YELLOW ,
857
+ animate : bool = False ,
857
858
** kwargs : Any ,
858
859
) -> Arrow :
859
860
"""
@@ -879,11 +880,11 @@ def add_vector(
879
880
Arrow
880
881
The arrow representing the vector.
881
882
"""
882
- vector = super ().add_vector (vector , color = color , ** kwargs )
883
+ vector = super ().add_vector (vector , color = color , animate = animate , ** kwargs )
883
884
self .moving_vectors .append (vector )
884
885
return vector
885
886
886
- def write_vector_coordinates (self , vector : Arrow , ** kwargs : Any ) -> Matrix :
887
+ def write_vector_coordinates (self , vector : Vector , ** kwargs : Any ) -> Matrix :
887
888
"""
888
889
Returns a column matrix indicating the vector coordinates,
889
890
after writing them to the screen, and adding them to the
@@ -941,11 +942,18 @@ def add_transformable_label(
941
942
The MathTex of the label.
942
943
"""
943
944
label_mob = self .label_vector (vector , label , ** kwargs )
945
+ # TODO
946
+ # In the following the label_mob is assumed to have these properties
947
+ # target_text, vector and kwargs.
948
+ # But the MathTex class do not have these properties and mypy complains
949
+ # about that.
950
+ # As a workaround I have added the properties to the MathTex class, but
951
+ # I do not like that solution...
944
952
if new_label :
945
953
label_mob .target_text = new_label
946
954
else :
947
955
label_mob .target_text = (
948
- f"{ transformation_name } ({ label_mob .get_tex_string ()} )"
956
+ f"{ transformation_name } ({ label_mob .get_tex_string ()} )" # type: ignore[no-untyped-call]
949
957
)
950
958
label_mob .vector = vector
951
959
label_mob .kwargs = kwargs
@@ -982,7 +990,7 @@ def add_title(
982
990
The scene with the title added to it.
983
991
"""
984
992
if not isinstance (title , (Mobject , OpenGLMobject )):
985
- title = Tex (title ).scale (scale_factor )
993
+ title = Tex (title ).scale (scale_factor ) # type: ignore[no-untyped-call]
986
994
title .to_edge (UP )
987
995
title .add_background_rectangle ()
988
996
if animate :
@@ -1242,7 +1250,7 @@ def apply_function(
1242
1250
kwargs ["run_time" ] = 3
1243
1251
anims = (
1244
1252
[
1245
- ApplyPointwiseFunction (function , t_mob )
1253
+ ApplyPointwiseFunction (function , t_mob ) # type: ignore[arg-type]
1246
1254
for t_mob in self .transformable_mobjects
1247
1255
]
1248
1256
+ [
0 commit comments