-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Adding type annotations to manim.utils.* #3999
base: main
Are you sure you want to change the base?
Adding type annotations to manim.utils.* #3999
Conversation
@@ -54,10 +56,12 @@ | |||
@overload | |||
def bezier( | |||
points: Sequence[Point3D_Array], | |||
) -> Callable[[float | ColVector], Point3D_Array]: ... | |||
) -> Callable[[float | ColVector], Point3D | Point3D_Array]: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
def interpolate(start: Point3D, end: Point3D, alpha: float) -> Point3D: ... | ||
def interpolate( | ||
start: InternalPoint3D, end: InternalPoint3D, alpha: float | ||
) -> Point3D: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
def interpolate(start: Point3D, end: Point3D, alpha: ColVector) -> Point3D_Array: ... | ||
def interpolate( | ||
start: InternalPoint3D, end: InternalPoint3D, alpha: ColVector | ||
) -> Point3D_Array: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
@@ -1099,10 +1115,12 @@ | |||
|
|||
|
|||
@overload | |||
def mid(start: Point3D, end: Point3D) -> Point3D: ... | |||
def mid(start: InternalPoint3D, end: InternalPoint3D) -> Point3D: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
def inverse_interpolate(start: float, end: float, value: Point3D) -> Point3D: ... | ||
def inverse_interpolate( | ||
start: float, end: float, value: InternalPoint3D | ||
) -> InternalPoint3D: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
def inverse_interpolate(start: Point3D, end: Point3D, value: Point3D) -> Point3D: ... | ||
def inverse_interpolate( | ||
start: InternalPoint3D, end: InternalPoint3D, value: InternalPoint3D | ||
) -> Point3D: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
|
||
|
||
def clip(a, min_a, max_a): | ||
@overload | ||
def clip(a: float, min_a: float, max_a: float) -> float: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
|
||
|
||
@overload | ||
def clip(a: str, min_a: str, max_a: str) -> str: ... |
Check notice
Code scanning / CodeQL
Statement has no effect Note
Overview: What does this pull request change?
The PR adds type annotations to some of the elements in manim/utils
Motivation and Explanation: Why and how do your changes improve the library?
Type annotations are a good thing.
Further Information and Comments
I have chosen to go for smaller PR regarding adding type annotations.
The endeavor of #3981 is a bit frightening...
Reviewer Checklist