mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 12:06:08 +00:00
wa/workloads: pylint fixes
This commit is contained in:
parent
6e94cbd36b
commit
9b2bc1369c
@ -55,7 +55,7 @@ class Antutu(ApkUiautoWorkload):
|
||||
try:
|
||||
result = float(match.group(1))
|
||||
except ValueError:
|
||||
result = 'NaN'
|
||||
result = 'NaN' #pylint: disable=redefined-variable-type
|
||||
entry = regex.pattern.rsplit(None, 1)[0]
|
||||
context.add_metric(entry, result, lower_is_better=False)
|
||||
expected_results -= 1
|
||||
|
@ -15,11 +15,11 @@
|
||||
|
||||
from __future__ import division
|
||||
import os
|
||||
|
||||
#pylint: disable=wrong-import-order,wrong-import-position
|
||||
from future.standard_library import install_aliases
|
||||
install_aliases()
|
||||
|
||||
from urllib.request import urlopen
|
||||
from urllib.request import urlopen #pylint: disable=import-error
|
||||
|
||||
from wa import Workload, Parameter, Alias, WorkloadError
|
||||
from wa.utils.exec_control import once
|
||||
@ -99,7 +99,7 @@ class ApacheBenchmark(Workload):
|
||||
wfh.write(self.output)
|
||||
context.add_artifact('ab-output', outfile, kind='raw')
|
||||
|
||||
def update_output(self, context):
|
||||
def update_output(self, context): #pylint: disable=too-many-locals
|
||||
with open(context.get_artifact_path('ab-output')) as fh:
|
||||
server_software = get_line(fh, 'Server Software').split(':')[1].strip()
|
||||
context.add_metadata('server-software', server_software)
|
||||
|
@ -92,6 +92,7 @@ class Applaunch(ApkUiautoWorkload):
|
||||
def init_resources(self, context):
|
||||
super(Applaunch, self).init_resources(context)
|
||||
self.workload_params['markers_enabled'] = True
|
||||
#pylint: disable=no-member
|
||||
self.workload = pluginloader.get_workload(self.workload_name, self.target,
|
||||
**self.workload_params)
|
||||
self.workload.init_resources(context)
|
||||
|
@ -174,5 +174,3 @@ def read_result_table(filepath):
|
||||
pass
|
||||
|
||||
return pd.DataFrame(entries, columns=columns)
|
||||
|
||||
|
||||
|
@ -162,4 +162,3 @@ class Dhrystone(Workload):
|
||||
raise ConfigError(msg)
|
||||
if not self.mloops and not self.duration: # pylint: disable=E0203
|
||||
self.mloops = self.default_mloops
|
||||
|
||||
|
@ -19,9 +19,11 @@ import re
|
||||
import os
|
||||
import time
|
||||
|
||||
#pylint: disable=wrong-import-position
|
||||
from future.standard_library import install_aliases
|
||||
install_aliases()
|
||||
|
||||
#pylint: disable=import-error, wrong-import-order
|
||||
import urllib.request
|
||||
import urllib.parse
|
||||
import urllib.error
|
||||
@ -111,6 +113,7 @@ class ExoPlayer(ApkWorkload):
|
||||
"""),
|
||||
]
|
||||
|
||||
#pylint: disable=access-member-before-definition
|
||||
def validate(self):
|
||||
if self.format and self.filename:
|
||||
raise ConfigError('Either format *or* filename must be specified; but not both.')
|
||||
@ -153,7 +156,7 @@ class ExoPlayer(ApkWorkload):
|
||||
'"format" to specify a different file.')
|
||||
return files[0]
|
||||
|
||||
def init_resources(self, context):
|
||||
def init_resources(self, context): #pylint: disable=unused-argument
|
||||
# Needs to happen first, as it sets self.format, which is required by
|
||||
# _find_host_video_file
|
||||
self.validate()
|
||||
|
@ -389,7 +389,7 @@ class GBScoreCalculator(object):
|
||||
context.add_metric('Geekbench Score', int(overall_score))
|
||||
|
||||
|
||||
class GeekbenchCorproate(Geekbench):
|
||||
class GeekbenchCorproate(Geekbench): #pylint: disable=too-many-ancestors
|
||||
name = "geekbench-corporate"
|
||||
is_corporate = True
|
||||
requires_network = False
|
||||
|
@ -12,10 +12,10 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
from wa import Parameter, ApkUiautoWorkload
|
||||
from wa.framework.exception import WorkloadError
|
||||
|
||||
|
||||
class GoogleMaps(ApkUiautoWorkload):
|
||||
|
||||
name = 'googlemaps'
|
||||
|
@ -120,5 +120,5 @@ class HWUITest(Workload):
|
||||
|
||||
@once
|
||||
def finalize(self, context):
|
||||
if (self.target_exe):
|
||||
if self.target_exe:
|
||||
self.target.uninstall(self.target_exe)
|
||||
|
@ -129,7 +129,7 @@ class Jankbench(ApkWorkload):
|
||||
else:
|
||||
self.extract_metrics_from_logcat(context)
|
||||
|
||||
def extract_metrics_from_db(self, context):
|
||||
def extract_metrics_from_db(self, context): #pylint: disable=no-self-use
|
||||
dbfile = context.get_artifact_path('jankbench-results')
|
||||
with sqlite3.connect(dbfile) as conn:
|
||||
df = pd.read_sql('select name, iteration, total_duration, jank_frame from ui_results', conn)
|
||||
|
@ -314,5 +314,3 @@ class Meabo(Workload):
|
||||
@once
|
||||
def _uninstall_executable(self):
|
||||
self.target.uninstall_executable(self.target_exe)
|
||||
|
||||
|
||||
|
@ -71,7 +71,7 @@ class Memcpy(Workload):
|
||||
|
||||
def setup(self, context):
|
||||
self.command = '{} -i {} -s {}'.format(Memcpy.target_exe, self.loops, self.buffer_size)
|
||||
for c in (self.cpus.list()):
|
||||
for c in self.cpus.list():
|
||||
self.command += ' -c {}'.format(c)
|
||||
self.result = None
|
||||
|
||||
|
@ -69,4 +69,3 @@ class Speedometer(UiautoWorkload):
|
||||
context.add_metric('Speedometer Score', result, 'Runs per minute', lower_is_better=False)
|
||||
else:
|
||||
raise WorkloadError("The Speedometer workload has failed. No score was obtainable.")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user