Skip to content

Commit

Permalink
adds proper rounding for coverage values
Browse files Browse the repository at this point in the history
  • Loading branch information
eyck committed Jun 21, 2022
1 parent cc59dc7 commit 5dc34e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pyucis_viewer/coverage_tree_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def populate_model(self):
cg_n = QStandardItem("TYPE: " + cg.instname)
cov_n = QStandardItem("%0.2f%%" % cg.coverage)
cov_p = QStandardItem()
cov_p.setData(cg.coverage, QtCore.Qt.UserRole+1000)
cov_p.setData(round(cg.coverage, 2), QtCore.Qt.UserRole+1000)
root.appendRow([cg_n, cov_n, cov_p])

# Add type coverpoints
Expand All @@ -64,7 +64,7 @@ def populate_covergroup_model(self, inst_n, cg):
cg_n = QStandardItem("INST: " + cg.name)
cov_n = QStandardItem("%0.2f%%" % cg.coverage)
cov_p = QStandardItem()
cov_p.setData(cg.coverage, QtCore.Qt.UserRole+1000)
cov_p.setData(round(cg.coverage, 2), QtCore.Qt.UserRole+1000)
inst_n.appendRow([cg_n, cov_n, cov_p])

for cp in cg.coverpoints:
Expand All @@ -77,7 +77,7 @@ def populate_coverpoint(self, cg_n, cp):
cp_n = QStandardItem("CVP: " + cp.name)
cov_n = QStandardItem("%0.2f%%" % cp.coverage)
cov_p = QStandardItem()
cov_p.setData(cp.coverage, QtCore.Qt.UserRole+1000)
cov_p.setData(round(cp.coverage, 2), QtCore.Qt.UserRole+1000)
cg_n.appendRow([cp_n, cov_n, cov_p])

for bn in cp.bins:
Expand All @@ -95,7 +95,7 @@ def populate_cross(self, cg_n, cr):
cr_n = QStandardItem("CROSS: " + cr.name)
cov_n = QStandardItem("%0.2f%%" % cr.coverage)
cov_p = QStandardItem()
cov_p.setData(cr.coverage, QtCore.Qt.UserRole+1000)
cov_p.setData(round(cr.coverage, 2), QtCore.Qt.UserRole+1000)
cg_n.appendRow([cr_n, cov_n, cov_p])

for bn in cr.bins:
Expand Down

0 comments on commit 5dc34e2

Please sign in to comment.