Skip to content
Snippets Groups Projects
Unverified Commit 725ec246 authored by Stefano Borini's avatar Stefano Borini Committed by GitHub
Browse files

Merge pull request #119 from force-h2020/add-kpi-flag-to-datavalue

Added new flag is_kpi to DataValue
parents b82b6044 7b6f02c4
No related branches found
No related tags found
No related merge requests found
from traits.api import HasStrictTraits, Any, String, Enum from traits.api import HasStrictTraits, Any, String, Enum, Bool
class DataValue(HasStrictTraits): class DataValue(HasStrictTraits):
...@@ -22,6 +22,9 @@ class DataValue(HasStrictTraits): ...@@ -22,6 +22,9 @@ class DataValue(HasStrictTraits):
#: A flag for the quality of the data. #: A flag for the quality of the data.
quality = Enum("AVERAGE", "POOR", "GOOD") quality = Enum("AVERAGE", "POOR", "GOOD")
# Set by the engine. True if the data value contains a KPI.
is_kpi = Bool(False)
def __str__(self): def __str__(self):
s = "{} {} = {}".format( s = "{} {} = {}".format(
...@@ -31,4 +34,8 @@ class DataValue(HasStrictTraits): ...@@ -31,4 +34,8 @@ class DataValue(HasStrictTraits):
s += " +/- {}".format(str(self.accuracy)) s += " +/- {}".format(str(self.accuracy))
s += " ({})".format(str(self.quality)) s += " ({})".format(str(self.quality))
if self.is_kpi:
s += " (KPI)"
return s return s
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment