Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

lol black

leotrs725b6acb5057
diff --git a/manim/config/utils.py b/manim/config/utils.py
index 812855654..7c4e0f94d 100644
--- a/manim/config/utils.py
+++ b/manim/config/utils.py
@@ -394,13 +394,13 @@ class ManimConfig(MutableMapping):
# Handle --custom_folders
if args.custom_folders:
for opt in [
- "media_dir",
- "video_dir",
- "images_dir",
- "text_dir",
- "tex_dir",
- "log_dir",
- "partial_movie_dir",
+ "media_dir",
+ "video_dir",
+ "images_dir",
+ "text_dir",
+ "tex_dir",
+ "log_dir",
+ "partial_movie_dir",
]:
self[opt] = self._parser["custom_folders"].get(opt, raw=True)
# --media_dir overrides the deaful.cfg file
@@ -759,24 +759,28 @@ class ManimConfig(MutableMapping):
"partial_movie_dir",
]
if key not in dirs:
- raise KeyError('must pass one of '
- '{media,video,images,text,tex,log}_dir '
- 'or {input,output}_file')
+ raise KeyError(
+ "must pass one of "
+ "{media,video,images,text,tex,log}_dir "
+ "or {input,output}_file"
+ )
- dirs.remove(key) # a path cannot contain itself
+ dirs.remove(key) # a path cannot contain itself
all_args = {k: self._d[k] for k in dirs}
all_args.update(kwargs)
- all_args['quality'] = f'{self.pixel_height}p{self.frame_rate}'
+ all_args["quality"] = f"{self.pixel_height}p{self.frame_rate}"
path = self._d[key]
- while '{' in path:
+ while "{" in path:
try:
path = path.format(**all_args)
except KeyError as exc:
- raise KeyError(f'{key} {self._d[key]} requires the following '
- + 'keyword arguments: '
- + " ".join(exc.args)) from exc
+ raise KeyError(
+ f"{key} {self._d[key]} requires the following "
+ + "keyword arguments: "
+ + " ".join(exc.args)
+ ) from exc
return Path(path) if path else None
diff --git a/manim/scene/scene_file_writer.py b/manim/scene/scene_file_writer.py
index 636dd8814..7de052e96 100644
--- a/manim/scene/scene_file_writer.py
+++ b/manim/scene/scene_file_writer.py
@@ -63,7 +63,7 @@ class SceneFileWriter(object):
exist, they will be created.
"""
- if config["dry_run"]: # in dry-run mode there is no output
+ if config["dry_run"]: # in dry-run mode there is no output
return
if config["input_file"]:
@@ -104,9 +104,9 @@ class SceneFileWriter(object):
self.partial_movie_directory = guarantee_existence(
config.get_dir(
- 'partial_movie_dir',
+ "partial_movie_dir",
scene_name=default_name,
- module_name=module_name
+ module_name=module_name,
)
)
diff --git a/tests/test_scene_rendering/test_cli_flags.py b/tests/test_scene_rendering/test_cli_flags.py
index 00a7c2828..a44bc8add 100644
--- a/tests/test_scene_rendering/test_cli_flags.py
+++ b/tests/test_scene_rendering/test_cli_flags.py
@@ -125,7 +125,7 @@ def test_custom_folders(tmp_path, manim_cfg_file, simple_scenes_path):
"-s",
"--media_dir",
str(tmp_path),
- "--custom_folders"
+ "--custom_folders",
]
out, err, exit_code = capture(command)
assert exit_code == 0, err