From 93e3aac6315c17a74e63f02053a3e8e2e6b21928 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 27 Aug 2019 16:54:17 +0200 Subject: improve benchmark code quality using pylint The description Benchmark member is replaced with class docstrings --- src/benchmarks/__init__.py | 1 + src/benchmarks/cfrac.py | 8 ++- src/benchmarks/dj_trace.py | 139 +++++++++++++++++++++-------------------- src/benchmarks/espresso.py | 11 ++-- src/benchmarks/falsesharing.py | 36 ++++++----- src/benchmarks/httpd.py | 9 ++- src/benchmarks/larson.py | 30 ++++----- src/benchmarks/lld.py | 34 +++++----- src/benchmarks/loop.py | 19 +++--- src/benchmarks/mysql.py | 36 ++++++----- src/benchmarks/realloc.py | 11 +++- src/benchmarks/t_test1.py | 16 ++--- 12 files changed, 190 insertions(+), 160 deletions(-) diff --git a/src/benchmarks/__init__.py b/src/benchmarks/__init__.py index e69de29..7117bb2 100644 --- a/src/benchmarks/__init__.py +++ b/src/benchmarks/__init__.py @@ -0,0 +1 @@ +"""allocbench benchmark definitions""" diff --git a/src/benchmarks/cfrac.py b/src/benchmarks/cfrac.py index 44bd213..85537a9 100644 --- a/src/benchmarks/cfrac.py +++ b/src/benchmarks/cfrac.py @@ -1,9 +1,11 @@ +""" Definition of the cfrac benchmark""" + from src.benchmark import Benchmark -class Benchmark_Cfrac(Benchmark): +class BenchmarkCfrac(Benchmark): + """TODO""" def __init__(self): self.name = "cfrac" - self.descrition = """TODO.""" self.cmd = "cfrac{binary_suffix} {num}" @@ -37,4 +39,4 @@ class Benchmark_Cfrac(Benchmark): self.export_stats_to_dataref("VmHWM") -cfrac = Benchmark_Cfrac() +cfrac = BenchmarkCfrac() diff --git a/src/benchmarks/dj_trace.py b/src/benchmarks/dj_trace.py index b262255..b837a9e 100644 --- a/src/benchmarks/dj_trace.py +++ b/src/benchmarks/dj_trace.py @@ -1,57 +1,57 @@ -import matplotlib.pyplot as plt -import numpy as np +"""Benchmark definition using the traces collected by DJ Delorie""" + import os -from urllib.request import urlretrieve import sys import re +from urllib.request import urlretrieve +import matplotlib.pyplot as plt +import numpy as np from src.benchmark import Benchmark from src.util import print_status -comma_sep_number_re = "(?:\\d*(?:,\\d*)?)*" -rss_re = "(?P" + comma_sep_number_re + ")" -time_re = "(?P