Skip to content

Improve FadeIn and FadeOut classes with error handling and type safety #4308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

GiorgosTsak
Copy link

Improved the FadeIn and FadeOut animation classes by adding error handling and type safety. Specifically, it introduces checks for the validity of mobjects, shift, target_position, and scale parameters, raising exceptions when incorrect types or values are provided. The creation of faded mobject copies is now validated to prevent unexpected runtime errors. Additionally, the scene cleanup process includes a try/except block around interpolate(0) to handle potential failures gracefully.

@@ -20,10 +20,9 @@
]

import numpy as np
from typing_extensions import Any
from typing import Any, Union

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Union' is not used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

Successfully merging this pull request may close these issues.

1 participant