diff --git a/_unittests/ut_xrun_doc/test_documentation_examples.py b/_unittests/ut_xrun_doc/test_documentation_examples.py index 6f6a5d1..9bf59e1 100644 --- a/_unittests/ut_xrun_doc/test_documentation_examples.py +++ b/_unittests/ut_xrun_doc/test_documentation_examples.py @@ -40,7 +40,7 @@ def run_test(self, fold: str, name: str, verbose=0) -> int: cmds = [sys.executable, "-u", os.path.join(fold, name)] p = subprocess.Popen(cmds, stdout=subprocess.PIPE, stderr=subprocess.PIPE) res = p.communicate() - out, err = res + _out, err = res st = err.decode("ascii", errors="ignore") if st and "Traceback" in st: if '"dot" not found in path.' in st: diff --git a/onnx_array_api/profiling.py b/onnx_array_api/profiling.py index 3a346e1..fc9cee9 100644 --- a/onnx_array_api/profiling.py +++ b/onnx_array_api/profiling.py @@ -281,7 +281,12 @@ def align_text(text, size): return text[:h] + "..." + text[-h + 1 :] dicts = self.as_dict(filter_node=filter_node, sort_key=sort_key) - max_nc = max(max(_["nc1"] for _ in dicts), max(_["nc2"] for _ in dicts)) + set1 = [_["nc1"] for _ in dicts] + set2 = [_["nc1"] for _ in dicts] + if set1 or set2: + max_nc = max([*set1, *set2]) + else: + max_nc = 1 dg = int(math.log(max_nc) / math.log(10) + 1.5) line_format = ( "{indent}{fct} -- {nc1: %dd} {nc2: %dd} -- {tin:1.5f} {tall:1.5f}" diff --git a/pyproject.toml b/pyproject.toml index a465006..982ace4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,12 @@ select = [ ] [tool.ruff.lint.per-file-ignores] -"**" = ["B905", "C401", "C408", "C413", "PYI041", "RUF012", "RUF100", "RUF010", "SIM108", "SIM910", "SIM110", "SIM102", "SIM114", "SIM103", "UP015", "UP027", "UP031", "UP034", "UP032", "UP006", "UP035", "UP007", "UP038"] +"**" = [ + "B905", "C401", "C408", "C413", "PYI041", + "RUF012", "RUF100", "RUF010", + "SIM108", "SIM910", "SIM110", "SIM102", "SIM114", "SIM103", + "UP015", "UP027", "UP031", "UP034", "UP032", "UP006", "UP035", "UP007", "UP038", "UP045" +] "**/plot*.py" = ["B018"] "_doc/examples/plot_first_example.py" = ["E402", "F811"] "_doc/examples/plot_onnxruntime.py" = ["E402", "F811"]