Skip to content

Converted all types of parameters in docstrings to proper type annotations #2988

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 6 commits into from
Nov 10, 2022
Merged
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
2 changes: 1 addition & 1 deletion manim/_config/__init__.py
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ def tempconfig(temp: ManimConfig | dict) -> _GeneratorContextManager:
Parameters
----------
temp : Union[:class:`ManimConfig`, :class:`dict`]
temp
Object whose keys will be used to temporarily update the global
``config``.
15 changes: 9 additions & 6 deletions manim/_config/logger_utils.py
Original file line number Diff line number Diff line change
@@ -56,10 +56,10 @@ def make_logger(
Parameters
----------
parser : :class:`configparser.ConfigParser`
parser
A parser containing any .cfg files in use.
verbosity : :class:`str`
verbosity
The verbosity level of the logger.
Returns
@@ -106,7 +106,7 @@ def parse_theme(parser: configparser.ConfigParser) -> Theme:
Parameters
----------
parser : :class:`configparser.ConfigParser`
parser
A parser containing any .cfg files in use.
Returns
@@ -148,9 +148,12 @@ def set_file_logger(scene_name: str, module_name: str, log_dir: Path) -> None:
Parameters
----------
config : :class:`ManimConfig`
The global config, used to determine the log file path.
scene_name
The name of the scene, used in the name of the log file.
module_name
The name of the module, used in the name of the log file.
log_dir
Path to the folder where log files are stored.
"""
# Note: The log file name will be
# <name_of_animation_file>_<name_of_scene>.log, gotten from config. So it
10 changes: 5 additions & 5 deletions manim/_config/utils.py
Original file line number Diff line number Diff line change
@@ -342,7 +342,7 @@ def update(self, obj: ManimConfig | dict) -> None:
Parameters
----------
obj : Union[:class:`ManimConfig`, :class:`dict`]
obj
The object to copy values from.
Returns
@@ -490,7 +490,7 @@ def digest_parser(self, parser: configparser.ConfigParser) -> ManimConfig:
Parameters
----------
parser : :class:`ConfigParser`
parser
An object reflecting the contents of one or many ``.cfg`` files. In
particular, it may reflect the contents of multiple files that have
been parsed in a cascading fashion.
@@ -664,7 +664,7 @@ def digest_args(self, args: argparse.Namespace) -> ManimConfig:
Parameters
----------
args : :class:`argparse.Namespace`
args
An object returned by :func:`.main_utils.parse_args()`.
Returns
@@ -1316,11 +1316,11 @@ def get_dir(self, key: str, **kwargs: str) -> Path:
Parameters
----------
key : :class:`str`
key
The config option to be resolved. Must be an option ending in
``'_dir'``, for example ``'media_dir'`` or ``'video_dir'``.
kwargs : :class:`str`
kwargs
Any strings to be used when resolving the directory.
Returns
5 changes: 2 additions & 3 deletions manim/animation/animation.py
Original file line number Diff line number Diff line change
@@ -415,9 +415,8 @@ def set_rate_func(
Parameters
----------
run_time
The new time the animation should take in seconds.
rate_func
The new function defining the animation progress based on the relative runtime (see :mod:`~.rate_functions`).
Copy link
Member

Choose a reason for hiding this comment

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

line length

Suggested change
The new function defining the animation progress based on the relative runtime (see :mod:`~.rate_functions`).
The new function defining the animation progress based
on the relative runtime (see :mod:`~.rate_functions`).

Returns
-------
8 changes: 4 additions & 4 deletions manim/animation/creation.py
Original file line number Diff line number Diff line change
@@ -138,7 +138,7 @@ class Create(ShowPartial):
Parameters
----------
mobject : :class:`~.VMobject`
mobject
The VMobject to animate.
Raises
@@ -374,7 +374,7 @@ class Unwrite(Write):
Parameters
----------
reverse : :class:`bool`
reverse
Set True to have the animation start erasing from the last submobject first.
Examples
@@ -542,7 +542,7 @@ class AddTextLetterByLetter(ShowIncreasingSubsets):
Parameters
----------
time_per_char : :class:`float`
time_per_char
Frequency of appearance of the letters.
.. tip::
@@ -585,7 +585,7 @@ class RemoveTextLetterByLetter(AddTextLetterByLetter):
Parameters
----------
time_per_char : :class:`float`
time_per_char
Frequency of appearance of the letters.
.. tip::
10 changes: 5 additions & 5 deletions manim/animation/indication.py
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ class FocusOn(Transform):
The color of the spotlight.
run_time
The duration of the animation.
kwargs : Any
kwargs
Additional arguments to be passed to the :class:`~.Succession` constructor
Examples
@@ -132,7 +132,7 @@ class Indicate(Transform):
The color the mobject temporally takes.
rate_func
The function definig the animation progress at every point in time.
kwargs : Any
kwargs
Additional arguments to be passed to the :class:`~.Succession` constructor
Examples
@@ -186,7 +186,7 @@ class Flash(AnimationGroup):
The time width used for the flash lines. See :class:`.~ShowPassingFlash` for more details.
run_time
The duration of the animation.
kwargs : Any
kwargs
Additional arguments to be passed to the :class:`~.Succession` constructor
Examples
@@ -486,7 +486,7 @@ class Wiggle(Animation):
Parameters
----------
mobject : Mobject
mobject
The mobject to wiggle.
scale_value
The factor by which the mobject will be temporarily scaled.
@@ -581,7 +581,7 @@ class Circumscribe(Succession):
The color of the surrounding shape.
run_time
The duration of the entire animation.
kwargs : Any
kwargs
Additional arguments to be passed to the :class:`~.Succession` constructor
Examples
Loading