mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Improve method name and docstrings
This commit is contained in:
parent
d86f8dcef6
commit
02ddf45664
2 changed files with 7 additions and 4 deletions
|
@ -143,8 +143,11 @@ def get_indent(code_lines: list[str], line_number: int) -> str:
|
||||||
return n_spaces * " "
|
return n_spaces * " "
|
||||||
|
|
||||||
|
|
||||||
def insert_embed_line_to_module(module: Module, run_config: Dict) -> None:
|
def insert_embed_line_to_module_exec(module: Module, run_config: Dict) -> None:
|
||||||
"""
|
"""
|
||||||
|
Loads the user code, inserts a self.embed() line at the given line_number
|
||||||
|
and executes the code.
|
||||||
|
|
||||||
This is hacky, but convenient. When user includes the argument "-e", it will try
|
This is hacky, but convenient. When user includes the argument "-e", it will try
|
||||||
to recreate a file that inserts the line `self.embed()` into the end of the scene's
|
to recreate a file that inserts the line `self.embed()` into the end of the scene's
|
||||||
construct method. If there is an argument passed in, it will insert the line after
|
construct method. If there is an argument passed in, it will insert the line after
|
||||||
|
@ -191,7 +194,7 @@ def insert_embed_line_to_module(module: Module, run_config: Dict) -> None:
|
||||||
def get_module(run_config: Dict) -> Module:
|
def get_module(run_config: Dict) -> Module:
|
||||||
module = ModuleLoader.get_module(run_config.file_name, run_config.is_reload)
|
module = ModuleLoader.get_module(run_config.file_name, run_config.is_reload)
|
||||||
if run_config.embed_line:
|
if run_config.embed_line:
|
||||||
insert_embed_line_to_module(module, run_config)
|
insert_embed_line_to_module_exec(module, run_config)
|
||||||
return module
|
return module
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -118,8 +118,8 @@ class InteractiveSceneEmbed:
|
||||||
open during the reload.
|
open during the reload.
|
||||||
|
|
||||||
If `embed_line` is provided, the scene will be reloaded at that line
|
If `embed_line` is provided, the scene will be reloaded at that line
|
||||||
number. This corresponds to the `linemarker` param of the
|
number. This corresponds to the `line_number` param of the
|
||||||
`extract_scene.insert_embed_line_to_module()` method.
|
`extract_scene.insert_embed_line_to_module_exec()` method.
|
||||||
|
|
||||||
Before reload, the scene is cleared and the entire state is reset, such
|
Before reload, the scene is cleared and the entire state is reset, such
|
||||||
that we can start from a clean slate. This is taken care of by the
|
that we can start from a clean slate. This is taken care of by the
|
||||||
|
|
Loading…
Add table
Reference in a new issue