From a2980bb14f909fbba31374bc203c4d530bf3fff0 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 12 Jul 2020 00:59:21 +0200 Subject: [mypy] fix/ignore all remaining mypy errors --- Makefile | 4 ++-- allocbench/benchmark.py | 5 +++-- allocbench/plots.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 96a1c6d..c304c0c 100644 --- a/Makefile +++ b/Makefile @@ -57,9 +57,9 @@ check-format: yapf -d $(PYTHONFILES) check-mypy: - mypy $(PYTHONFILES) + mypy --ignore-missing-imports $(PYTHONFILES) tags: ctags -R --exclude="build/*" --exclude="cache/*" --exclude="doc/*" --exclude="results/*" -check: check-pylint check-format +check: check-pylint check-format check-mypy diff --git a/allocbench/benchmark.py b/allocbench/benchmark.py index 70be8f7..75de4f1 100644 --- a/allocbench/benchmark.py +++ b/allocbench/benchmark.py @@ -238,6 +238,7 @@ class Benchmark: print_debug("Results directory:", self.result_dir) def prepare(self): + """Default prepare function which only checks dependencies""" self.check_requirements() def save(self, path=None): @@ -748,7 +749,7 @@ class Benchmark: def get_benchmark_object(benchmark_name: str) -> Optional[Benchmark]: - """Find the first Benchmark class in allocbench.benchmarks.{benchmark_name} and return an instance""" + """Return an object of first Benchmark subclass in allocbench.benchmarks.{benchmark_name}""" bench_module = importlib.import_module( f"allocbench.benchmarks.{benchmark_name}") # find Benchmark class @@ -757,6 +758,6 @@ def get_benchmark_object(benchmark_name: str) -> Optional[Benchmark]: or not issubclass(member, Benchmark)): continue - return member() + return member() # type: ignore return None diff --git a/allocbench/plots.py b/allocbench/plots.py index c93c42e..ef69214 100644 --- a/allocbench/plots.py +++ b/allocbench/plots.py @@ -589,7 +589,7 @@ def create_ascii_leaderboards(bench, datapoints: List[Tuple[str, str]]): datapoint: get_ordered_results(bench, datapoint, order=order) for datapoint, order in datapoints } - combined = [] + # combined = [] for datapoint, leaderboard in leaderboards.items(): res += f'leaderboard for "{datapoint}":\n' -- cgit v1.2.3