-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add classes MethodWithArgs
, SceneInteractContinue
and SceneInteractRerun
inside new module manim.data_structures
#4315
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b8031a1
Add classes MethodWithArgs, SceneInteractRerun and SceneInteractExit
chopan050 de8c5dd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a7c3a2e
Add missing manim.data_structures file
chopan050 6291c41
Rename SceneInteractExit to SceneInteractContinue and use dataclasses
chopan050 81da8ad
Empty commit
chopan050 1bdb9d1
Revert using @dataclass(slots=True), because Python 3.9 does not supp…
chopan050 faa8eaa
Change order of dataclasses
chopan050 c800f79
Add references to Scene.queue in docstrings
chopan050 518c7d7
Merge branch 'main' of https://github.com/ManimCommunity/manim into d…
chopan050 12295ae
Include data_structures in utilities_misc.rst
chopan050 a7f8f84
Use qualified names and mark strings as code in data_structures.py
chopan050 fe80dd9
Add module docstring to data_structures.py
chopan050 e9cdff8
Move Scene.interact() objects from data_structures.py into scene.py
chopan050 addc408
Use qualified name in SceneInteractAction docstring
chopan050 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""Data classes and other necessary data structures for use in Manim.""" | ||
|
||
from __future__ import annotations | ||
|
||
from collections.abc import Iterable | ||
from dataclasses import dataclass | ||
from types import MethodType | ||
from typing import Any | ||
|
||
|
||
@dataclass | ||
class MethodWithArgs: | ||
"""Object containing a :attr:`method` which is intended to be called later | ||
with the positional arguments :attr:`args` and the keyword arguments | ||
:attr:`kwargs`. | ||
|
||
Attributes | ||
---------- | ||
method : MethodType | ||
A callable representing a method of some class. | ||
args : Iterable[Any] | ||
Positional arguments for :attr:`method`. | ||
kwargs : dict[str, Any] | ||
Keyword arguments for :attr:`method`. | ||
""" | ||
|
||
__slots__ = ["method", "args", "kwargs"] | ||
|
||
method: MethodType | ||
args: Iterable[Any] | ||
kwargs: dict[str, Any] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / CodeQL
Commented-out code Note