Skip to content

Commit 33a01d3

Browse files
committed
fix: lint driven fixes
1 parent b23d014 commit 33a01d3

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

dyana/loaders/automodel/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import torch
77
from transformers import AutoModel, AutoTokenizer
88

9-
from dyana import get_current_imports, get_gpu_usage, get_peak_rss
9+
from dyana import get_current_imports, get_gpu_usage, get_peak_rss # type: ignore[attr-defined]
1010

1111
if __name__ == "__main__":
1212
parser = argparse.ArgumentParser(description="Profile model files")

dyana/loaders/base/dyana.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@contextmanager
9-
def capture_output():
9+
def capture_output() -> t.Generator[tuple[StringIO, StringIO], None, None]:
1010
"""
1111
Context manager to capture stdout and stderr
1212
@@ -63,11 +63,11 @@ def get_gpu_usage() -> list[dict[str, t.Any]]:
6363
return usage
6464

6565

66-
def get_current_imports() -> dict[str, str]:
66+
def get_current_imports() -> dict[str, str | None]:
6767
"""
6868
Get the currently imported modules.
6969
"""
70-
imports = {}
70+
imports: dict[str, str | None] = {}
7171

7272
# for each loaded module
7373
for module_name, module in sys.modules.items():

dyana/loaders/elf/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import subprocess
55
import typing as t
66

7-
from dyana import get_peak_rss
7+
from dyana import get_peak_rss # type: ignore[attr-defined]
88

99
if __name__ == "__main__":
1010
parser = argparse.ArgumentParser(description="Run an ELF file")

dyana/loaders/pickle/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pickle
55
import typing as t
66

7-
from dyana import get_current_imports, get_peak_rss
7+
from dyana import get_current_imports, get_peak_rss # type: ignore[attr-defined]
88

99
if __name__ == "__main__":
1010
parser = argparse.ArgumentParser(description="Run a pickle file")

dyana/loaders/python/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import runpy
55
import typing as t
66

7-
from dyana import capture_output, get_current_imports, get_peak_rss
7+
from dyana import capture_output, get_current_imports, get_peak_rss # type: ignore[attr-defined]
88

99
if __name__ == "__main__":
1010
parser = argparse.ArgumentParser(description="Run an Python file")

dyana/view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def view_extra_unknown(key: str, value: t.Any) -> None:
267267
def count_package_prefixes(path_dict: dict[str, str], level: int = 2) -> dict[str, int]:
268268
from collections import defaultdict
269269

270-
prefix_counter = defaultdict(int)
270+
prefix_counter: defaultdict[str, int] = defaultdict(int)
271271

272272
for package_path in path_dict.keys():
273273
parts = package_path.split(".")

0 commit comments

Comments
 (0)