Skip to content

Commit d9091b7

Browse files
committed
switch from matplotlib to bokeh in metricset
1 parent 53e38cf commit d9091b7

File tree

13 files changed

+375
-340
lines changed

13 files changed

+375
-340
lines changed

pypop/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
from .version import get_version
1414

15-
__all__ = ['__version__']
15+
__all__ = ["__version__"]
1616

1717
__version__ = get_version()
18-
19-

pypop/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from os.path import normpath, expanduser
99

10-
__all__ = ['set_paramedir_path', 'set_dimemas_path', 'set_tmpdir_path']
10+
__all__ = ["set_paramedir_path", "set_dimemas_path", "set_tmpdir_path"]
1111

1212
_dimemas_path = None
1313
_paramedir_path = None

pypop/dimemas.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ def dimemas_idealise(tracefile, outpath=None):
5959

6060
# Pass trace, run config and path to idealisation skeleton config and let
6161
# dimemas_analyze work its subtle magic(k)s
62-
return dimemas_analyse(
63-
tracefile, IDEAL_CONF_PATH, outpath, subs
64-
)
62+
return dimemas_analyse(tracefile, IDEAL_CONF_PATH, outpath, subs)
6563

6664

6765
def dimemas_analyse(tracefile, configfile, outpath=None, substrings=None):
@@ -93,7 +91,7 @@ def dimemas_analyse(tracefile, configfile, outpath=None, substrings=None):
9391

9492
# Perform all work in a tempdir with predictable names,
9593
# this works around a series of weird dimemas bugs
96-
94+
9795
# Make sure config._tmpdir_path exists before using it
9896
if config._tmpdir_path:
9997
try:
@@ -142,7 +140,7 @@ def dimemas_analyse(tracefile, configfile, outpath=None, substrings=None):
142140
# Now create the dim file for dimemas
143141
tmp_dim = os.path.join(workdir, splitext(basename(tmp_prv))[0] + ".dim")
144142

145-
prv2dim_binpath = 'prv2dim'
143+
prv2dim_binpath = "prv2dim"
146144
if config._dimemas_path:
147145
prv2dim_binpath = os.path.join(config._dimemas_path, prv2dim_binpath)
148146

@@ -165,7 +163,7 @@ def dimemas_analyse(tracefile, configfile, outpath=None, substrings=None):
165163
except Exception as err:
166164
raise RuntimeError("prv2dim execution_failed: {}".format(err))
167165

168-
dimemas_binpath = 'Dimemas'
166+
dimemas_binpath = "Dimemas"
169167
if config._dimemas_path:
170168
dimemas_binpath = os.path.join(config._dimemas_path, dimemas_binpath)
171169

@@ -228,4 +226,4 @@ def dimemas_analyse(tracefile, configfile, outpath=None, substrings=None):
228226
shutil.rmtree(workdir, ignore_errors=True)
229227

230228
# finally return outpath as promised
231-
return os.path.join(outpath,filestem + ".sim.prv")
229+
return os.path.join(outpath, filestem + ".sim.prv")

pypop/extrae.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ def chop_prv_to_roi(prv_file, outfile=None):
111111
if outfile:
112112
workdir = dirname(normpath(outfile))
113113
else:
114-
tgtname = ".chop".join(splitext(basename(prv_file)))
114+
tgtname = ".chop".join(splitext(basename(prv_file)))
115115
# Make sure config._tmpdir_path exists before using it
116116
if config._tmpdir_path:
117117
try:
118118
os.makedirs(config._tmpdir_path, exist_ok=True)
119119
except OSError as err:
120120
print("FATAL: {}".format(err))
121-
workdir = mkdtemp(dir=config._tmpdir_path)
121+
workdir = mkdtemp(dir=config._tmpdir_path)
122122
outfile = os.path.join(workdir, tgtname)
123123

124124
roi_filter = resource_filename(__name__, ROI_FILTER_XML)
@@ -183,7 +183,8 @@ def chop_prv_to_roi(prv_file, outfile=None):
183183
)
184184

185185
return outfile
186-
186+
187+
187188
def _get_roi_times(roi_prv):
188189
""" Extract ROi timing information from a filtered trace
189190
@@ -195,20 +196,16 @@ def _get_roi_times(roi_prv):
195196
df = data.event
196197

197198
# Get the first on and last off events
198-
grouped = df.reset_index(level='time').groupby(level=['task','thread'])
199+
grouped = df.reset_index(level="time").groupby(level=["task", "thread"])
199200
ons = grouped.nth(1)
200-
offs = grouped.last()
201-
201+
offs = grouped.last()
202+
202203
# Check the events have the expected values
203-
if not (ons['value'] == 1).all():
204-
raise ValueError(
205-
"Unexpected event value: expected 40000012:1"
206-
)
207-
if not (offs['value'] == 0).all():
208-
raise ValueError(
209-
"Unexpected event value: expected 40000012:0"
210-
)
211-
return ons['time'].min(), 1 + offs['time'].max()
204+
if not (ons["value"] == 1).all():
205+
raise ValueError("Unexpected event value: expected 40000012:1")
206+
if not (offs["value"] == 0).all():
207+
raise ValueError("Unexpected event value: expected 40000012:0")
208+
return ons["time"].min(), 1 + offs["time"].max()
212209

213210

214211
def paramedir_analyze(
@@ -381,16 +378,16 @@ def run_paramedir(tracefile, paramedir_config, outfile=None, variables=None):
381378
outfile: str
382379
Path to the output file.
383380
"""
384-
381+
385382
# Make sure config._tmpdir_path exists before using it
386383
if config._tmpdir_path:
387384
try:
388385
os.makedirs(config._tmpdir_path, exist_ok=True)
389386
except OSError as err:
390387
print("FATAL: {}".format(err))
391-
388+
392389
tmpdir = mkdtemp(dir=config._tmpdir_path)
393-
390+
394391
# If variables is none, still sub with empty dict
395392
variables = variables if variables else {}
396393
tmp_config = _write_substituted_config(paramedir_config, tmpdir, variables)

pypop/metrics/hybrid.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def _calculate_metrics(self, ref_key=None, sort_keys=True):
250250
class MPI_OpenMP_Multiplicative_Metrics(MetricSet):
251251
"""Proposed Hybrid MPI+OpenMP Metrics (multiplicative version).
252252
"""
253+
253254
_metric_list = [
254255
Metric("Global Efficiency", 0, desc=k_GE_desc),
255256
Metric("Parallel Efficiency", 1, desc=k_PE_desc),

0 commit comments

Comments
 (0)