1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 12:06:08 +00:00

Updated pylint for v1.5.1

Fixed WA for the latest version of pylint (1.5.1)
This commit is contained in:
Sebastian Goscik 2015-12-09 15:43:35 +00:00
parent 344bc519c4
commit bef8fb40ef
35 changed files with 86 additions and 102 deletions

View File

@ -35,10 +35,10 @@ compare_versions() {
}
pylint_version=$(python -c 'from pylint.__pkginfo__ import version; print version')
compare_versions $pylint_version "1.3.0"
compare_versions $pylint_version "1.5.1"
result=$?
if [ "$result" == "2" ]; then
echo "ERROR: pylint version must be at least 1.3.0; found $pylint_version"
echo "ERROR: pylint version must be at least 1.5.1; found $pylint_version"
exit 1
fi

View File

@ -16,7 +16,7 @@
#
[MASTER]
profile=no
#profile=no
ignore=external

View File

@ -164,7 +164,7 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
raise DeviceError('Could not boot {} ({}).'.format(self.name, self.adb_name))
while iteration_number < max_iterations:
available = (1 == int('0' + adb_shell(self.adb_name, 'getprop sys.boot_completed', timeout=self.default_timeout)))
available = (int('0' + (adb_shell(self.adb_name, 'getprop sys.boot_completed', timeout=self.default_timeout))) == 1)
if available:
break
else:
@ -331,10 +331,7 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
self._check_ready()
output = adb_shell(self.adb_name, 'if [ -e \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath),
timeout=self.default_timeout)
if int(output):
return True
else:
return False
return bool(int(output))
def install(self, filepath, timeout=default_timeout, with_name=None): # pylint: disable=W0221
ext = os.path.splitext(filepath)[1].lower()
@ -739,4 +736,3 @@ class BigLittleDevice(AndroidDevice): # pylint: disable=W0223
parameters = [
Parameter('scheduler', default='hmp', override=True),
]

View File

@ -248,7 +248,7 @@ class BaseLinuxDevice(Device): # pylint: disable=abstract-method
self.execute('echo {} > \'{}\''.format(value, sysfile), check_exit_code=False, as_root=True)
if verify:
output = self.get_sysfile_value(sysfile)
if not output.strip() == value: # pylint: disable=E1103
if output.strip() != value: # pylint: disable=E1103
message = 'Could not set the value of {} to {}'.format(sysfile, value)
raise DeviceError(message)
self._written_sysfiles.append(sysfile)
@ -476,7 +476,7 @@ class BaseLinuxDevice(Device): # pylint: disable=abstract-method
if isinstance(on_cpus, basestring):
on_cpus = ranges_to_list(on_cpus)
if isiterable(on_cpus):
on_cpus = list_to_mask(on_cpus)
on_cpus = list_to_mask(on_cpus) # pylint: disable=redefined-variable-type
command = '{} taskset 0x{:x} {}'.format(self.busybox, on_cpus, command)
if in_directory:
command = 'cd {} && {}'.format(in_directory, command)
@ -807,4 +807,3 @@ class LinuxDevice(BaseLinuxDevice):
def ensure_screen_is_on(self):
pass # TODO

View File

@ -16,13 +16,12 @@
import os
from copy import copy
from collections import OrderedDict, defaultdict
import yaml
from wlauto.exceptions import ConfigError
from wlauto.utils.misc import load_struct_from_yaml, LoadSyntaxError
from wlauto.utils.types import counter, reset_counter
import yaml
def get_aliased_param(d, aliases, default=None, pop=True):
alias_map = [i for i, a in enumerate(aliases) if a in d]

View File

@ -303,7 +303,7 @@ class Device(Extension):
params = OrderedDict((k.lower(), v) for k, v in params.iteritems() if v is not None)
expected_keys = rtp_map.keys()
if not set(params.keys()) <= set(expected_keys):
if not set(params.keys()).issubset(set(expected_keys)):
unknown_params = list(set(params.keys()).difference(set(expected_keys)))
raise ConfigError('Unknown runtime parameter(s): {}'.format(unknown_params))
@ -447,4 +447,3 @@ class Device(Extension):
except Exception as e:
self.ping()
raise e

View File

@ -18,6 +18,7 @@ import sys
import argparse
import logging
import subprocess
import warnings
from wlauto.core.bootstrap import settings
from wlauto.core.extension_loader import ExtensionLoader
@ -28,7 +29,6 @@ from wlauto.utils.cli import init_argument_parser
from wlauto.utils.doc import format_body
import warnings
warnings.filterwarnings(action='ignore', category=UserWarning, module='zope')
@ -89,4 +89,3 @@ def main():
logging.critical(tb)
logging.critical('{}({})'.format(e.__class__.__name__, e))
sys.exit(2)

View File

@ -80,7 +80,7 @@ class GlobalParameterAlias(object):
other_param.kind != param.kind):
message = 'Duplicate global alias {} declared in {} and {} extensions with different types'
raise LoaderError(message.format(self.name, ext.name, other_ext.name))
if not param.name == other_param.name:
if param.name != other_param.name:
message = 'Two params {} in {} and {} in {} both declare global alias {}'
raise LoaderError(message.format(param.name, ext.name,
other_param.name, other_ext.name, self.name))
@ -320,7 +320,7 @@ class ExtensionLoader(object):
if should_skip:
continue
for fname in files:
if not os.path.splitext(fname)[1].lower() == '.py':
if os.path.splitext(fname)[1].lower() != '.py':
continue
filepath = os.path.join(root, fname)
try:
@ -401,4 +401,3 @@ def _instantiate(cls, args=None, kwargs=None):
return cls(*args, **kwargs)
except Exception:
raise LoaderError('Could not load {}'.format(cls), sys.exc_info())

View File

@ -98,8 +98,8 @@ class Gem5AndroidDevice(BaseGem5Device, AndroidDevice):
self.logger.info("Waiting for Android to boot...")
while True:
try:
booted = (1 == int('0' + self.gem5_shell('getprop sys.boot_completed', check_exit_code=False)))
anim_finished = (1 == int('0' + self.gem5_shell('getprop service.bootanim.exit', check_exit_code=False)))
booted = (int('0' + self.gem5_shell('getprop sys.boot_completed', check_exit_code=False)) == 1)
anim_finished = (int('0' + self.gem5_shell('getprop service.bootanim.exit', check_exit_code=False)) == 1)
if booted and anim_finished:
break
except (DeviceError, ValueError):

View File

@ -14,7 +14,7 @@
#
# pylint: disable=E1101,E1103
# pylint: disable=E1101,E1103,wrong-import-position
import os
import sys

View File

@ -59,7 +59,7 @@ class DeviceConfiguration(Serializable):
def validate(self):
if not self.number_of_ports:
raise ConfigurationError('No resistor values were specified.')
if not len(self.resistor_values) == len(self.labels):
if len(self.resistor_values) != len(self.labels):
message = 'The number of resistors ({}) does not match the number of labels ({})'
raise ConfigurationError(message.format(len(self.resistor_values), len(self.labels)))
@ -151,4 +151,3 @@ def get_config_parser(server=True, device=True):
parser.add_argument('--host', action=UpdateServerConfig)
parser.add_argument('--port', action=UpdateServerConfig, type=int)
return parser

View File

@ -42,7 +42,7 @@ Port 0
:sampling_rate: The rate at which DAQ takes a sample from each channel.
"""
# pylint: disable=F0401,E1101,W0621,no-name-in-module
# pylint: disable=F0401,E1101,W0621,no-name-in-module,wrong-import-position,wrong-import-order
import os
import sys
import csv
@ -302,7 +302,7 @@ class DaqRunner(object):
if callbacks_supported:
self.task = ReadSamplesCallbackTask(config, self.processor)
else:
self.task = ReadSamplesThreadedTask(config, self.processor)
self.task = ReadSamplesThreadedTask(config, self.processor) # pylint: disable=redefined-variable-type
self.is_running = False
def start(self):
@ -334,7 +334,7 @@ if __name__ == '__main__':
resistor_values = [0.005]
labels = ['PORT_0']
dev_config = DeviceConfig('Dev1', channel_map, resistor_values, 2.5, 0.2, 10000, len(resistor_values), labels)
if not len(sys.argv) == 3:
if len(sys.argv) != 3:
print 'Usage: {} OUTDIR DURATION'.format(os.path.basename(__file__))
sys.exit(1)
output_directory = sys.argv[1]

View File

@ -14,7 +14,7 @@
#
# pylint: disable=E1101,W0613
# pylint: disable=E1101,W0613,wrong-import-position
from __future__ import division
import os
import sys
@ -30,12 +30,12 @@ from twisted.internet.protocol import Factory, Protocol
from twisted.internet import reactor, interfaces
from twisted.internet.error import ConnectionLost, ConnectionDone
if __name__ == "__main__": # for debugging
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from daqpower import log
from daqpower.config import DeviceConfiguration
from daqpower.common import DaqServerRequest, DaqServerResponse, Status
try:
from daqpower.daq import DaqRunner, list_available_devices, CAN_ENUMERATE_DEVICES
__import_error = None
@ -66,7 +66,7 @@ class DummyDaqRunner(object):
self.is_running = False
def start(self):
import csv, random
import csv, random # pylint: disable=multiple-imports
log.info('runner started')
for i in xrange(self.config.number_of_ports):
rows = [['power', 'voltage']] + [[random.gauss(1.0, 1.0), random.gauss(1.0, 0.1)]

View File

@ -31,6 +31,7 @@ from wlauto.exceptions import ConfigError, InstrumentError, DeviceError
from wlauto.utils.misc import ensure_directory_exists as _d
from wlauto.utils.types import list_of_ints, list_of_strs, boolean
# pylint: disable=wrong-import-position,wrong-import-order
daqpower_path = os.path.join(os.path.dirname(__file__), '..', '..', 'external', 'daq_server', 'src')
sys.path.insert(0, daqpower_path)
try:
@ -283,7 +284,7 @@ class Daq(Instrument):
self._results = None
self._metrics = set()
if self.labels:
if not (len(self.labels) == len(self.resistor_values)): # pylint: disable=superfluous-parens
if len(self.labels) != len(self.resistor_values):
raise ConfigError('Number of DAQ port labels does not match the number of resistor values.')
else:
self.labels = ['PORT_{}'.format(i) for i, _ in enumerate(self.resistor_values)]
@ -319,7 +320,7 @@ class Daq(Instrument):
for name in old_names:
if name not in self.labels:
raise ConfigError("No channel with label {} specified".format(name))
self.label_map = self.merge_channels
self.label_map = self.merge_channels # pylint: disable=redefined-variable-type
self.merge_channels = True
else: # Should never reach here
raise AssertionError("Merge files is of invalid type")

View File

@ -820,7 +820,7 @@ def _adjust_for_thermal(data, filt_method=lambda x: x, thresh=0.9, window=5000,
if __name__ == '__main__':
import sys
import sys # pylint: disable=wrong-import-position,wrong-import-order
indir, outdir = sys.argv[1], sys.argv[2]
device_name = 'odroidxu3'
big_core = 'a15'

View File

@ -27,6 +27,10 @@ import tempfile
from distutils.version import LooseVersion
try:
import pandas as pd
except ImportError:
pd = None
from wlauto import Instrument, Parameter, IterationResult
from wlauto.instrumentation import instrument_is_installed
@ -34,11 +38,6 @@ from wlauto.exceptions import (InstrumentError, WorkerThreadError, ConfigError,
DeviceNotRespondingError, TimeoutError)
from wlauto.utils.types import boolean, numeric
try:
import pandas as pd
except ImportError:
pd = None
VSYNC_INTERVAL = 16666667
PAUSE_LATENCY = 20

View File

@ -148,7 +148,7 @@ class PerfInstrument(Instrument):
self.events = [self.events]
if not self.labels: # pylint: disable=E0203
self.labels = ['perf_{}'.format(i) for i in xrange(len(self.optionstrings))]
if not len(self.labels) == len(self.optionstrings):
if len(self.labels) != len(self.optionstrings):
raise ConfigError('The number of labels must match the number of optstrings provided for perf.')
def _build_commands(self):
@ -173,4 +173,3 @@ class PerfInstrument(Instrument):
event_string,
self._get_device_outfile(label))
return command

View File

@ -146,7 +146,7 @@ class CciPmuLogger(Instrument):
raise ConfigError('To use cci_pmu_logger, trace-cmd instrument must also be enabled.')
if not self.event_labels: # pylint: disable=E0203
self.event_labels = ['event_{}'.format(e) for e in self.events]
elif not len(self.events) == len(self.event_labels):
elif len(self.events) != len(self.event_labels):
raise ConfigError('cci_pmu_events and cci_pmu_event_labels must be of the same length.')
if len(self.events) > NUMBER_OF_CCI_PMU_COUNTERS:
raise ConfigError('The number cci_pmu_counters must be at most {}'.format(NUMBER_OF_CCI_PMU_COUNTERS))

View File

@ -20,15 +20,17 @@ import os
import shutil
import webbrowser
try:
import jinja2
except ImportError:
jinja2 = None
from wlauto import File, Parameter, ResultProcessor
from wlauto.exceptions import ConfigError, ResultProcessorError
import wlauto.utils.ipython as ipython
from wlauto.utils.misc import open_file
try:
import jinja2
except ImportError:
jinja2 = None
DEFAULT_NOTEBOOK_TEMPLATE = 'template.ipynb'

View File

@ -51,6 +51,7 @@ workloads:
instrumentation: [fsp]
"""
class MockExtensionLoader(object):
def __init__(self):
@ -94,7 +95,7 @@ class NamedMock(object):
self.parameters = []
def __getattr__(self, name):
if not name in self.__attrs:
if name not in self.__attrs:
self.__attrs[name] = NamedMock(name)
return self.__attrs[name]
@ -164,7 +165,7 @@ class ConfigTest(TestCase):
def test_list_defaults_params(self):
ws = AgendaWorkloadEntry(id='a', iterations=1,
name='defaults_workload', workload_parameters={'param':[3]})
name='defaults_workload', workload_parameters={'param': [3]})
self.config.set_agenda(MockAgenda(ws))
spec = self.config.workload_specs[0]
assert_equal(spec.workload_parameters, {'param': [3]})

View File

@ -82,8 +82,10 @@ class BadDeviceMeta(DeviceMeta):
basemethods = [getattr(b, vmname) for b in bases if hasattr(b, vmname)]
methods[vmname] = [bm for bm in basemethods if bm != clsmethod]
methods[vmname].append(clsmethod)
def generate_method_wrapper(vname):
name__ = vmname
def wrapper(self, *args, **kwargs):
for dm in methods[name__]:
dm(self, *args, **kwargs)
@ -101,31 +103,31 @@ class BadDevice(Device):
self.exception = exception
def connect(self):
if 'connect' == self.when_to_fail:
if self.when_to_fail == 'connect':
raise self.exception("Connection failure")
def initialize(self, _):
if 'initialize' == self.when_to_fail:
if self.when_to_fail == 'initialize':
raise self.exception("Initialisation failure")
def get_properties(self, _):
if 'get_properties' == self.when_to_fail:
if self.when_to_fail == 'get_properties':
raise self.exception("Failure getting propeties")
def start(self):
if 'start' == self.when_to_fail:
if self.when_to_fail == 'start':
raise self.exception("Start failure")
def set_device_parameters(self, **_):
if 'set_device_parameters' == self.when_to_fail:
if self.when_to_fail == 'set_device_parameters':
raise self.exception("Failure setting parameter")
def stop(self):
if 'stop' == self.when_to_fail:
if self.when_to_fail == 'stop':
raise self.exception("Stop failure")
def disconnect(self):
if 'disconnect' == self.when_to_fail:
if self.when_to_fail == 'disconnect':
raise self.exception("Disconnection failure")
def ping(self):
@ -718,14 +720,14 @@ class RunnerTest(TestCase):
expected_signals = [
signal.RUN_START.name,
signal.RUN_INIT.name,
signal.WORKLOAD_SPEC_START.name, #Fail Setup
signal.WORKLOAD_SPEC_START.name, # Fail Setup
signal.ITERATION_START.name,
signal.BEFORE_WORKLOAD_SETUP.name,
signal.AFTER_WORKLOAD_SETUP.name,
signal.ITERATION_END.name,
#Skipped iteration
signal.WORKLOAD_SPEC_END.name,
signal.WORKLOAD_SPEC_START.name, #Fail Run
signal.WORKLOAD_SPEC_START.name, # Fail Run
signal.ITERATION_START.name,
signal.BEFORE_WORKLOAD_SETUP.name,
signal.SUCCESSFUL_WORKLOAD_SETUP.name,
@ -753,7 +755,7 @@ class RunnerTest(TestCase):
signal.AFTER_WORKLOAD_TEARDOWN.name,
signal.ITERATION_END.name,
signal.WORKLOAD_SPEC_END.name,
signal.WORKLOAD_SPEC_START.name, # Fail Result Update
signal.WORKLOAD_SPEC_START.name, # Fail Result Update
signal.ITERATION_START.name,
signal.BEFORE_WORKLOAD_SETUP.name,
signal.SUCCESSFUL_WORKLOAD_SETUP.name,
@ -781,7 +783,7 @@ class RunnerTest(TestCase):
signal.AFTER_WORKLOAD_TEARDOWN.name,
signal.ITERATION_END.name,
signal.WORKLOAD_SPEC_END.name,
signal.WORKLOAD_SPEC_START.name, # Fail Teardown
signal.WORKLOAD_SPEC_START.name, # Fail Teardown
signal.ITERATION_START.name,
signal.BEFORE_WORKLOAD_SETUP.name,
signal.SUCCESSFUL_WORKLOAD_SETUP.name,
@ -809,7 +811,7 @@ class RunnerTest(TestCase):
signal.AFTER_WORKLOAD_TEARDOWN.name,
signal.ITERATION_END.name,
signal.WORKLOAD_SPEC_END.name,
signal.WORKLOAD_SPEC_START.name, #OK
signal.WORKLOAD_SPEC_START.name, # OK
signal.ITERATION_START.name,
signal.BEFORE_WORKLOAD_SETUP.name,
signal.SUCCESSFUL_WORKLOAD_SETUP.name,
@ -1065,4 +1067,3 @@ class RunnerTest(TestCase):
def _instantiate(cls, *args, **kwargs):
# Needed to get around Extension's __init__ checks
return cls(*args, **kwargs)

View File

@ -222,11 +222,7 @@ def poll_for_file(device, dfile):
command = "adb " + device_string + " shell \" if [ -f " + dfile + " ] ; then true ; else false ; fi\" "
logger.debug(command)
result = subprocess.call(command, stderr=subprocess.PIPE, shell=True)
if not result:
return True
else:
return False
return not bool(result)
am_start_error = re.compile(r"Error: Activity class {[\w|.|/]*} does not exist")

View File

@ -18,6 +18,7 @@ import os
import subprocess
from distutils.version import StrictVersion
# pylint: disable=wrong-import-position
import_error_str = ''
try:
import IPython
@ -28,7 +29,7 @@ except ImportError as import_error:
if import_error.message.startswith("No module named"): # pylint: disable=E1101
import_error_str = 'ipynb_exporter requires ipython package to be installed'
else:
import_error_str = import_error.message
import_error_str = import_error.message # pylint: disable=redefined-variable-type
# The current code generates notebooks version 3
NBFORMAT_VERSION = 3

View File

@ -250,7 +250,7 @@ def get_traceback(exc=None):
def merge_dicts(*args, **kwargs):
if not len(args) >= 2:
if len(args) < 2:
raise ValueError('Must specify at least two dicts to merge.')
func = partial(_merge_two_dicts, **kwargs)
return reduce(func, args)
@ -314,7 +314,7 @@ def _merge_two_dicts(base, other, list_duplicates='all', match_types=False, # p
def merge_lists(*args, **kwargs):
if not len(args) >= 2:
if len(args) < 2:
raise ValueError('Must specify at least two lists to merge.')
func = partial(_merge_two_lists, **kwargs)
return reduce(func, args)
@ -696,7 +696,7 @@ def load_struct_from_python(filepath=None, text=None):
for k, v in mod.__dict__.iteritems()
if not k.startswith('_'))
except SyntaxError as e:
raise LoadSyntaxError(e.message, e.filepath, e.lineno)
raise LoadSyntaxError(e.message, filepath, e.lineno)
def load_struct_from_yaml(filepath=None, text=None):
@ -713,7 +713,7 @@ def load_struct_from_yaml(filepath=None, text=None):
except yaml.YAMLError as e:
lineno = None
if hasattr(e, 'problem_mark'):
lineno = e.problem_mark.line
lineno = e.problem_mark.line # pylint: disable=no-member
raise LoadSyntaxError(e.message, filepath=filepath, lineno=lineno)

View File

@ -51,7 +51,7 @@ class KshellConnection(object):
def login(self, user, password):
code, out = self.send_command('login {} {}\r\n'.format(user, password))
if not code == 250:
if code != 250:
raise NetioError('Login failed. Got: {} {}'.format(code, out))
def enable_port(self, port):
@ -64,7 +64,7 @@ class KshellConnection(object):
def set_port(self, port, value):
code, out = self.send_command('port {} {}'.format(port, value))
if not code == 250:
if code != 250:
raise NetioError('Could not set {} on port {}. Got: {} {}'.format(value, port, code, out))
def send_command(self, command):
@ -95,4 +95,3 @@ class KshellConnection(object):
def close(self):
self.conn.close()

View File

@ -19,6 +19,8 @@ from contextlib import contextmanager
from distutils.version import StrictVersion as V
import serial
# pylint: disable=ungrouped-imports
import pexpect
if V(pexpect.__version__) < V('4.0.0'):
import fdpexpect # pylint: disable=import-error
@ -118,5 +120,3 @@ def open_serial_connection(timeout, get_conn=False, init_dtr=None, *args, **kwar
target.close() # Closes the file descriptor used by the conn.
del conn

View File

@ -43,7 +43,7 @@ def ssh_get_shell(host, username, password=None, keyfile=None, port=None, timeou
raise ConfigError('keyfile may not be used with a telnet connection.')
conn = TelnetConnection()
else: # ssh
conn = pxssh.pxssh()
conn = pxssh.pxssh() # pylint: disable=redefined-variable-type
try:
if keyfile:
conn.login(host, username, ssh_key=keyfile, port=port, login_timeout=timeout)
@ -274,4 +274,3 @@ def process_backspaces(text):
else:
chars.append(c)
return ''.join(chars)

View File

@ -79,7 +79,7 @@ class Antutu(AndroidUiAutoBenchmark):
if self.version == '4.0.3':
metrics = extract_version4_metrics(fh)
else:
metrics = extract_older_version_metrics(fh)
metrics = extract_older_version_metrics(fh) # pylint: disable=redefined-variable-type
for key, value in metrics.iteritems():
key = key.replace(' ', '_')
context.result.add_metric(key, value)
@ -118,7 +118,7 @@ def extract_older_version_metrics(fh):
for line in fh:
if 'i/antutu' in line.lower():
parts = line.split(':')
if not len(parts) == 3:
if len(parts) != 3:
continue
metric = parts[1].strip()
value = int(parts[2].strip())
@ -132,4 +132,3 @@ def extract_older_version_metrics(fh):
metrics[metric] = value
return metrics

View File

@ -14,11 +14,11 @@
# pylint: disable=W0201, C0103
from wlauto import Workload, Parameter, Executable
import os
import re
from wlauto import Workload, Parameter, Executable
results_txt = 'ebizzy_results.txt'
record_regex = re.compile(r'(?P<record>\d+) records/s')
result_regex = re.compile(r'(?P<metric>\D+)(?P<value>\d+.*\b)(?P<unit>\S+)')

View File

@ -14,11 +14,12 @@
# pylint: disable=W0201, C0103
from wlauto import Workload, Parameter, Executable
import os
import re
from wlauto import Workload, Parameter, Executable
hackbench_results_txt = 'hackbench_results.txt'
regex_map = {"total_groups": (re.compile(r'(\d+) groups'), "groups"),

View File

@ -44,7 +44,7 @@ class IdleWorkload(Workload):
def setup(self, context):
if self.stop_android:
if not self.device.platform == 'android':
if self.device.platform != 'android':
raise ConfigError('stop_android can only be set for Android devices')
if not self.device.is_rooted:
raise WorkloadError('Idle workload requires the device to be rooted in order to stop Android.')
@ -66,4 +66,3 @@ class IdleWorkload(Workload):
time.sleep(0.2)
while self.device.execute('getprop init.svc.bootanim').strip() == 'running':
time.sleep(1)

View File

@ -12,16 +12,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=attribute-defined-outside-init
from wlauto import Workload, Parameter, Executable
from wlauto.exceptions import ConfigError
from wlauto.utils.types import list_of_ints
from collections import OrderedDict
from itertools import izip_longest
import os
import re
import csv
from wlauto import Workload, Parameter, Executable
from wlauto.exceptions import ConfigError
from wlauto.utils.types import list_of_ints
iozone_results_txt = 'iozone_results.txt'

View File

@ -119,10 +119,7 @@ class Spec2000(Workload):
# (also more than just summary/non-summary classification?)
class _SPECSummaryMetrics(object):
def __contains__(self, item):
if item.endswith('_real'):
return True
else:
return False
return item.endswith('_real')
asset_file = 'spec2000-assets.tar.gz'
@ -351,4 +348,3 @@ class CommandSpec(object):
self.datadir = None
self.command = None
self.threads = None

View File

@ -12,11 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# pylint: disable=attribute-defined-outside-init
import os
import re
from wlauto import Workload, Parameter, Executable
import os
import re
stream_results_txt = 'stream_results.txt'
system_array_regex = re.compile(r'^This system uses (\d)')

View File

@ -300,8 +300,7 @@ def parse_telemetry_results(filepath):
if __name__ == '__main__':
import sys
from pprint import pprint
import sys # pylint: disable=wrong-import-order,wrong-import-position
from pprint import pprint # pylint: disable=wrong-import-order,wrong-import-position
path = sys.argv[1]
pprint(parse_telemetry_results(path))