From 228101e7ea2b5a2c068e5c6d24e8a486b9ec980e Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 13 Jul 2020 15:53:33 +0200 Subject: [print_facts.py] update way of retrieving benchmark objects --- scripts/print_facts.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'scripts/print_facts.py') diff --git a/scripts/print_facts.py b/scripts/print_facts.py index 6099b6f..dfb07a6 100755 --- a/scripts/print_facts.py +++ b/scripts/print_facts.py @@ -19,7 +19,6 @@ """Print facts about an allocbench result directory""" import argparse -import importlib import os import sys @@ -27,10 +26,9 @@ CURRENTDIR = os.path.dirname(os.path.abspath(__file__)) PARENTDIR = os.path.dirname(CURRENTDIR) sys.path.insert(0, PARENTDIR) -from allocbench.benchmark import AVAIL_BENCHMARKS +from allocbench.benchmark import AVAIL_BENCHMARKS, get_benchmark_object import allocbench.facter as facter from allocbench.plots import print_facts, print_common_facts -from allocbench.util import print_error def main(): @@ -48,14 +46,7 @@ def main(): os.chdir(args.results) for benchmark in AVAIL_BENCHMARKS: - bench_module = importlib.import_module( - f"allocbench.benchmarks.{benchmark}") - - if not hasattr(bench_module, benchmark): - print_error(f"{benchmark} has no member {benchmark}") - print_error(f"Skipping {benchmark}.") - - bench = getattr(bench_module, benchmark) + bench = get_benchmark_object(benchmark) try: bench.load() -- cgit v1.2.3