From 508505390b44a45696094a56ea90362e0ec6192f Mon Sep 17 00:00:00 2001 From: RujitRaval Date: Mon, 26 Aug 2019 12:28:22 -0400 Subject: [PATCH] Updated score range for PNA --- bpeng/pna/discrete_bar_graph.py | 1 - bpeng/pna/pna.py | 46 ++++++++++++++++----------------- bpeng/pna/template.py | 6 ----- 3 files changed, 22 insertions(+), 31 deletions(-) diff --git a/bpeng/pna/discrete_bar_graph.py b/bpeng/pna/discrete_bar_graph.py index bb5cace..3044e44 100644 --- a/bpeng/pna/discrete_bar_graph.py +++ b/bpeng/pna/discrete_bar_graph.py @@ -18,7 +18,6 @@ def create_graph_factory(name_in_ppt, num_colored, total=5, horizontal=True, bla continue if shape.has_table: if shape.table.cell(0,0).text.find('___' + name_in_ppt + '___') != -1: - print("found table graph") if horizontal: row = shape.table.rows[0] i = 0 diff --git a/bpeng/pna/pna.py b/bpeng/pna/pna.py index 053474e..d97df31 100644 --- a/bpeng/pna/pna.py +++ b/bpeng/pna/pna.py @@ -405,57 +405,55 @@ def calculate_bar_color_number(scores): num3 = 0 num_list = [] - if scores[0][1] in range(0, 4): + if scores[0][1] in range(0, 2): num0 = 0 - elif scores[0][1] in range(4, 7): + elif scores[0][1] in range(2, 4): num0 = 1 - elif scores[0][1] in range(7, 9): + elif scores[0][1] in range(4, 5): num0 = 2 - elif scores[0][1] in range(9, 11): + elif scores[0][1] in range(5, 6): num0 = 3 - elif scores[0][1] in range(11, 13): + elif scores[0][1] in range(6, 9): num0 = 4 - elif scores[0][1] in range(13, 17): + elif scores[0][1] in range(9, 12): num0 = 5 - if scores[1][1] in range(0, 15): + if scores[1][1] in range(0, 3): num1 = 0 - elif scores[1][1] in range(15, 20): + elif scores[1][1] in range(3, 5): num1 = 1 - elif scores[1][1] in range(20, 23): + elif scores[1][1] in range(5, 8): num1 = 2 - elif scores[1][1] in range(23, 27): + elif scores[1][1] in range(8, 9): num1 = 3 - elif scores[1][1] in range(27, 31): + elif scores[1][1] in range(9, 12): num1 = 4 - elif scores[1][1] in range(31, 35): + elif scores[1][1] in range(12, 16): num1 = 5 - if scores[2][1] == 0: - num2 = 0 - elif scores[2][1] in range(1, 3): + if scores[2][1] in range(0, 2): num2 = 1 - elif scores[2][1] in range(3, 6): + elif scores[2][1] in range(2, 4): num2 = 2 - elif scores[2][1] in range(6, 10): + elif scores[2][1] in range(4, 5): num2 = 3 - elif scores[2][1] in range(10, 13): + elif scores[2][1] in range(5, 8): num2 = 4 - elif scores[2][1] in range(13, 16): + elif scores[2][1] in range(8, 11): num2 = 5 if scores[3][1] in range(0, 12): num3 = 0 elif scores[3][1] in range(12, 18): - num3 = 0 + num3 = 1 elif scores[3][1] in range(18, 22): - num3 = 0 + num3 = 2 elif scores[3][1] in range(22, 26): - num3 = 0 + num3 = 3 elif scores[3][1] in range(26, 31): - num3 = 0 + num3 = 4 elif scores[3][1] in range(31, 36): - num3 = 0 + num3 = 5 num_list.append(num0) num_list.append(num1) diff --git a/bpeng/pna/template.py b/bpeng/pna/template.py index 500b734..64c9780 100644 --- a/bpeng/pna/template.py +++ b/bpeng/pna/template.py @@ -33,19 +33,14 @@ class TemplateSlideInstantiator(): self.extra_functions = [] def add_substitutions(self, subs): - print("add subs") for sub in subs: - print(sub.name_in_ppt) self.substitutions.append(sub) def add_function(self, fun): self.extra_functions.append(fun) def render(self, slide): - print("render") - print(self.substitutions) for sub in self.substitutions: - print("iterating through subs: do search for " + sub.name_in_ppt) sub.render(slide) for function in self.extra_functions: @@ -76,7 +71,6 @@ class Substitution(): to format the string for better presentation form """ self.name_in_ppt = '___{}___'.format(name_in_ppt) - print(self.name_in_ppt) self.value = str(value) self.font = font self.font_size = font_size -- GitLab