Skip to content

Conversation

@Viicos
Copy link
Member

@Viicos Viicos commented Nov 16, 2023

Part of #3375.

def __init__(
self,
vmobject: VMobject,
rate_func: Callable[[float], float] = linear,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should rate_func be passed to super? (i.e. in this case Write). It is currently unused.

self.suspend_mobject_updating: bool = suspend_mobject_updating
self.lag_ratio: float = lag_ratio
self._on_finish: Callable[[Scene], None] = _on_finish
self.run_time = run_time

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute run_time, which was previously defined in subclass [Flash](1). Assignment overwrites attribute run_time, which was previously defined in subclass [TransformAnimations](2). Assignment overwrites attribute run_time, which was previously defined in subclass [TransformAnimations](3).
self.lag_ratio: float = lag_ratio
self._on_finish: Callable[[Scene], None] = _on_finish
self.run_time = run_time
self.rate_func = rate_func

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute rate_func, which was previously defined in subclass [AnimationGroup](1). Assignment overwrites attribute rate_func, which was previously defined in subclass [ChangeSpeed](2).
self.rate_func = rate_func
self.reverse_rate_function = reverse_rate_function
self.name = name
self.remover = remover

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute remover, which was previously defined in subclass [ShowPassingFlashWithThinningStrokeWidth](1).
@Viicos
Copy link
Member Author

Viicos commented Nov 16, 2023

pointwise_become_partial is only available on VMobject, so the type hint is probably invalid here?

def interpolate_submobject(
self,
submobject: Mobject,
starting_submobject: Mobject,
alpha: float,
) -> None:
submobject.pointwise_become_partial(
starting_submobject, *self._get_bounds(alpha)
)

@Viicos Viicos mentioned this pull request Nov 16, 2023
22 tasks
@chopan050 chopan050 added the documentation Improvements or additions to documentation label Dec 21, 2023
@Viicos Viicos mentioned this pull request Jan 3, 2024
MappingFunction: TypeAlias = Callable[[Point3D], Point3D]
"""A function mapping a `Point3D` to another `Point3D`."""

RateFunc: TypeAlias = Callable[[float], float]

Check notice

Code scanning / CodeQL

Unused global variable

The global variable 'RateFunc' is not used.
@JasonGrace2282
Copy link
Member

pointwise_become_partial is only available on VMobject, so the type hint is probably invalid here?

def interpolate_submobject(
self,
submobject: Mobject,
starting_submobject: Mobject,
alpha: float,
) -> None:
submobject.pointwise_become_partial(
starting_submobject, *self._get_bounds(alpha)
)

It would seem so!

@Viicos Viicos marked this pull request as ready for review February 13, 2024 17:13
@Viicos
Copy link
Member Author

Viicos commented Feb 13, 2024

Consider this a first pass. They are still too many mypy errors to actually enable this module. I first want to go over simple modules and I'll come back to this one later.

@JasonGrace2282 JasonGrace2282 added typehints For adding/discussing typehints and removed documentation Improvements or additions to documentation labels Apr 18, 2024
@JasonGrace2282 JasonGrace2282 marked this pull request as draft May 28, 2024 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

typehints For adding/discussing typehints

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

3 participants