Skip to content

Commit b9d2cd9

Browse files
authored
chore(docs): improve docstrings (#18)
1 parent 620bb30 commit b9d2cd9

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

manim_slides/commons.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
from typing import Callable
2+
13
import click
24

35
from .defaults import CONFIG_PATH
46

57

6-
def config_path_option(function):
8+
def config_path_option(function) -> Callable:
9+
"""Wraps a function to add configuration path option."""
710
return click.option(
811
"-c",
912
"--config",
@@ -14,7 +17,8 @@ def config_path_option(function):
1417
)(function)
1518

1619

17-
def config_options(function):
20+
def config_options(function) -> Callable:
21+
"""Wraps a function to add configuration options."""
1822
function = config_path_option(function)
1923
function = click.option(
2024
"-f", "--force", is_flag=True, help="Overwrite any existing configuration file."

manim_slides/defaults.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import cv2
44

55
FONT_ARGS = (cv2.FONT_HERSHEY_SIMPLEX, 1, 255, 1, cv2.LINE_AA)
6-
PIXELS_PER_CHARACTER = 20
76
FOLDER_PATH: str = "./slides"
87
CONFIG_PATH: str = ".manim-slides.json"
98

manim_slides/present.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __str__(self) -> str:
3737

3838

3939
def now() -> int:
40-
"""Returns time.time() in seconds."""
40+
"""Returns time.time() in milliseconds."""
4141
return round(time.time() * 1000)
4242

4343

@@ -292,7 +292,7 @@ def __init__(
292292
)
293293
cv2.resizeWindow(WINDOW_NAME, *resolution)
294294

295-
def resize_frame_to_screen(self, frame: np.ndarray):
295+
def resize_frame_to_screen(self, frame: np.ndarray) -> np.ndarray:
296296
"""
297297
Resizes a given frame to match screen dimensions.
298298

manim_slides/wizard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from .commons import config_options
99
from .config import Config
10-
from .defaults import CONFIG_PATH, FONT_ARGS, PIXELS_PER_CHARACTER
10+
from .defaults import CONFIG_PATH, FONT_ARGS
1111

1212
WINDOW_NAME = "Manim Slides Configuration Wizard"
1313
WINDOW_SIZE = (120, 620)
@@ -51,6 +51,7 @@ def init(config_path, force, merge, skip_interactive=False):
5151

5252

5353
def _init(config_path, force, merge, skip_interactive=False):
54+
"""Actual initialization code for configuration file, with optional interactive mode."""
5455

5556
if os.path.exists(config_path):
5657
click.secho(f"The `{CONFIG_PATH}` configuration file exists")

0 commit comments

Comments
 (0)