Skip to content

Commit e459e4c

Browse files
committed
build(docs): pass mkdocs --strict by adding missing type hints and docstring fixes
1 parent 051625a commit e459e4c

4 files changed

Lines changed: 8 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,7 @@ If using providers not present in the built-in pricing DB, set both `model_input
316316
### Local MkDocs Site
317317
1. Install the documentation dependencies: `pip install mkdocs mkdocs-material mkdocstrings mkdocstrings-python`
318318
2. Serve the docs locally to `http://127.0.0.1:8000/`: `mkdocs serve`
319-
320-
Use `mkdocs build` to generate a static site in the `site/` directory.
319+
3. Use `mkdocs build` to generate a static site in the `site/` directory.
321320

322321
### Reference Materials
323322
- [Schema Reference](SCHEMA_REFERENCE.md) - Detailed schema configuration guide

src/delm/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,9 @@ def from_yaml(cls, path: Path) -> "DELMConfig":
687687
return cls.from_dict(data)
688688

689689
@staticmethod
690-
def from_any(config_like) -> "DELMConfig":
690+
def from_any(
691+
config_like: "DELMConfig | dict[str, Any] | str | Path",
692+
) -> "DELMConfig":
691693
"""Create ``DELMConfig`` from various input types.
692694
693695
Args:

src/delm/delm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def from_yaml(
136136
config_path: Union[str, Path],
137137
experiment_name: str,
138138
experiment_directory: Path,
139-
**kwargs,
139+
**kwargs: Any,
140140
) -> "DELM":
141141
"""Create a DELM instance from a YAML configuration file.
142142
@@ -168,7 +168,7 @@ def from_dict(
168168
config_dict: Dict[str, Any],
169169
experiment_name: str,
170170
experiment_directory: Path,
171-
**kwargs,
171+
**kwargs: Any,
172172
) -> "DELM":
173173
"""Create a DELM instance from a configuration dictionary.
174174

src/delm/utils/retry_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __init__(self, max_retries: int = 3, base_delay: float = 1.0):
2020
self.max_retries = max_retries
2121
self.base_delay = base_delay
2222

23-
def execute_with_retry(self, func: Callable, *args, **kwargs) -> Any:
23+
def execute_with_retry(self, func: Callable, *args: Any, **kwargs: Any) -> Any:
2424
"""Execute function with retry logic.
2525
2626
Args:
@@ -32,7 +32,7 @@ def execute_with_retry(self, func: Callable, *args, **kwargs) -> Any:
3232
The result of the function execution.
3333
3434
Raises:
35-
The last exception from the function execution if all attempts fail.
35+
Exception: The last exception from the function execution if all attempts fail.
3636
"""
3737
exceptions = []
3838
for attempt in range(self.max_retries + 1):

0 commit comments

Comments
 (0)