Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/manim_data_structures/m_array.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains classes to construct an array."""
from __future__ import annotations

from copy import deepcopy

Expand Down Expand Up @@ -627,7 +628,7 @@ def __sum_elem_len(self, index_start: int, index_end: int) -> int:
total_len += self.__mob_arr[i].fetch_mob_square().side_length
return total_len

def __calc_label_pos_and_mob(self) -> typing.Tuple[Square, np.ndarray]:
def __calc_label_pos_and_mob(self) -> tuple[Square, np.ndarray]:
"""Calculates the position of the array label relative to one of the element's square mobjects.

Returns
Expand Down Expand Up @@ -818,7 +819,7 @@ def __remove_elem(
update_anim_args: dict = {},
removal_anim_target: MArrayElementComp = None,
update_anim_target: MArrayElementComp = MArrayElementComp.INDEX,
) -> typing.Tuple[Succession, typing.Callable[[bool], typing.List[Animation]]]:
) -> tuple[Succession, typing.Callable[[bool], list[Animation]]]:
"""Removes the element from the array at the specified index.

Parameters
Expand Down Expand Up @@ -1453,7 +1454,7 @@ def remove_elem(
update_anim_target: MArrayElementComp = MArrayElementComp.INDEX,
play_anim: bool = True,
play_anim_args: dict = {},
) -> typing.Tuple[Succession, typing.Callable[[bool], typing.List[Animation]]]:
) -> tuple[Succession, typing.Callable[[bool], list[Animation]]]:
"""Removes the element from the array at the specified index.

Parameters
Expand Down Expand Up @@ -2046,7 +2047,7 @@ class MArraySlidingWindow(VGroup):
]
"""Maps :class:`~.m_enum.MArrayDirection` to :class:`np.ndarray`."""

def __calc_window_dim(self) -> typing.Tuple[float, float]:
def __calc_window_dim(self) -> tuple[float, float]:
"""Calculates dimensions of window mobject.

Returns
Expand All @@ -2067,7 +2068,7 @@ def __calc_window_dim(self) -> typing.Tuple[float, float]:

return (height, width)

def __calc_window_pos_np(self) -> typing.Tuple[np.ndarray, np.ndarray]:
def __calc_window_pos_np(self) -> tuple[np.ndarray, np.ndarray]:
"""Calculates position vector and align vector for the window mobject.

Returns
Expand Down
4 changes: 4 additions & 0 deletions src/manim_data_structures/m_variable.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
"""Contains classes to construct variable."""

from __future__ import annotations

from typing import Any

from manim import *

from .m_array import MArrayElement
Expand Down