From 9f1043dad45eb0ee4c6d69d029e40705d9001446 Mon Sep 17 00:00:00 2001 From: Vighnesh Iyer Date: Wed, 13 Mar 2024 13:52:01 -0700 Subject: [PATCH] fix pyright switch nits --- hammer/sim/vcs/__init__.py | 4 ++-- hammer/technology/asap7/gds_scale.py | 2 ++ hammer/vlsi/hammer_tool.py | 2 +- pyproject.toml | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hammer/sim/vcs/__init__.py b/hammer/sim/vcs/__init__.py index 138cfca91..57537f17c 100644 --- a/hammer/sim/vcs/__init__.py +++ b/hammer/sim/vcs/__init__.py @@ -266,7 +266,7 @@ def run_simulation(self) -> bool: stime: Optional[TimeValue] = None if saif_mode == "time": assert saif_start_time - stime = TimeValue(saif_start_time[0]) + stime = TimeValue(saif_start_time) find_regs_run_tcl.append("run {start}ns".format(start=stime.value_in_units("ns"))) elif saif_mode == "trigger_raw": find_regs_run_tcl.append(saif_start_trigger_raw) @@ -299,7 +299,7 @@ def run_simulation(self) -> bool: stime: Optional[TimeValue] = None if saif_mode == "time": assert saif_start_time - stime = TimeValue(saif_start_time[0]) + stime = TimeValue(saif_start_time) find_regs_run_tcl.append("run {start}ns".format(start=stime.value_in_units("ns"))) elif saif_mode == "trigger_raw": find_regs_run_tcl.append(saif_start_trigger_raw) diff --git a/hammer/technology/asap7/gds_scale.py b/hammer/technology/asap7/gds_scale.py index a17fb9f3b..aca4c5c12 100755 --- a/hammer/technology/asap7/gds_scale.py +++ b/hammer/technology/asap7/gds_scale.py @@ -4,6 +4,7 @@ # This is called by a tech hook that should be inserted post write_design import sys, glob, os, re +from typing import Any def main(): assert len(sys.argv) == 3, 'Must have 2 arguments: 1) Path to list of standard cells, 2) Path to GDS file' @@ -26,6 +27,7 @@ def main(): # load the standard cell list cell_list = [line.rstrip() for line in open(stdcells, 'r')] + gds_lib: Any = None if gds_tool.__name__ == 'gdstk': # load original_gds gds_lib = gds_tool.read_gds(infile=gds_file) diff --git a/hammer/vlsi/hammer_tool.py b/hammer/vlsi/hammer_tool.py index 01823198b..e9c254deb 100644 --- a/hammer/vlsi/hammer_tool.py +++ b/hammer/vlsi/hammer_tool.py @@ -272,7 +272,7 @@ def run_dir(self) -> str: try: return self._rundir except AttributeError: - return self._rundir + raise ValueError("Internal error: run dir location not set by hammer-vlsi") @run_dir.setter def run_dir(self, path: str) -> None: diff --git a/pyproject.toml b/pyproject.toml index 064283301..31be1d1ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -85,7 +85,7 @@ reports = true disable = ["no-else-return", "len-as-condition"] [tool.pyright] -exclude = ["doc/**", "e2e/**", "test_scripts/**", "hammer/technology/asap7/gds_scale.py"] +exclude = ["doc/**", "e2e/**", "test_scripts/**"] include = ["hammer", "tests"] reportMissingImports = true typeCheckingMode = "standard"