Skip to content

Commit 53800fa

Browse files
author
tibut
committed
allows plottagboxplot to run without tag argument
1 parent e4a5d1d commit 53800fa

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

bitflow/steps/plotprocessingsteps.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PlotTagBoxplot(ProcessingStep):
1111

1212
def __init__(self,
1313
metric_name : str,
14-
tag : str,
14+
tag : str = "",
1515
filename : str = "",
1616
ylabel : str = "",
1717
xlabel : str = "",
@@ -64,10 +64,15 @@ def execute(self,sample):
6464
except ValueError:
6565
self.write(sample)
6666

67-
tv = sample.get_tag(self.tag)
68-
if tv not in self.values:
69-
self.values[tv] = []
70-
self.values[tv].append(float(sample.metrics[index]))
67+
if self.tag == "":
68+
if not self.metric_name in self.values:
69+
self.values[self.metric_name]= []
70+
self.values[self.metric_name].append(float(sample.metrics[index]))
71+
else:
72+
tv = sample.get_tag(self.tag)
73+
if tv not in self.values:
74+
self.values[tv] = []
75+
self.values[tv].append(float(sample.metrics[index]))
7176

7277
self.write(sample)
7378

@@ -134,7 +139,7 @@ def __init__(self,
134139
raise NotSupportedError("{}: file format, {}, not supported ...".format(file_format))
135140

136141
if filename == "":
137-
self.filename = self.__name__ + "-" + metric_name + "." + file_format
142+
self.filename = self.__name__ + "-" + self.metric_names[0] + "." + file_format
138143
else:
139144
self.filename = filename
140145
if ylabel == "":

0 commit comments

Comments
 (0)