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
Show file tree
Hide file tree
Changes from 5 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
Expand Up @@ -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``.

Expand Down
15 changes: 9 additions & 6 deletions manim/_config/logger_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions manim/_config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def make_config_parser(custom_file: str = None) -> configparser.ConfigParser:

Parameters
----------
custom_file : :class:`str`
custom_file
Path to a custom config file. If used, the folder-wide file in the
relevant directory will be ignored, if it exists. If None, the
folder-wide file will be used, if it exists.
Expand Down Expand Up @@ -340,7 +340,7 @@ def update(self, obj: ManimConfig | dict) -> None:

Parameters
----------
obj : Union[:class:`ManimConfig`, :class:`dict`]
obj
The object to copy values from.

Returns
Expand Down Expand Up @@ -488,7 +488,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.
Expand Down Expand Up @@ -662,7 +662,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
Expand Down Expand Up @@ -818,7 +818,7 @@ def digest_file(self, filename: str) -> ManimConfig:

Parameters
----------
filename : :class:`str`
filename
Path to the ``.cfg`` file.

Returns
Expand Down Expand Up @@ -1314,11 +1314,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
Expand Down
5 changes: 2 additions & 3 deletions manim/animation/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------
Expand Down
8 changes: 4 additions & 4 deletions manim/animation/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Create(ShowPartial):

Parameters
----------
mobject : :class:`~.VMobject`
mobject
The VMobject to animate.

Raises
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -542,7 +542,7 @@ class AddTextLetterByLetter(ShowIncreasingSubsets):

Parameters
----------
time_per_char : :class:`float`
time_per_char
Frequency of appearance of the letters.

.. tip::
Expand Down Expand Up @@ -585,7 +585,7 @@ class RemoveTextLetterByLetter(AddTextLetterByLetter):

Parameters
----------
time_per_char : :class:`float`
time_per_char
Frequency of appearance of the letters.

.. tip::
Expand Down
10 changes: 5 additions & 5 deletions manim/animation/indication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
Loading