Outer score calculation formula
(innerscore_dict, pereffect_totalaffected, weight)
| 108 | return innerscore |
| 109 | |
| 110 | def calc_outerscore(innerscore_dict, pereffect_totalaffected, weight): |
| 111 | """Outer score calculation formula""" |
| 112 | # Return just max of the inner scores, including weight factor |
| 113 | if float(len(innerscore_dict)): |
| 114 | outerscore = innerscore_dict[max(innerscore_dict, key=lambda a: |
| 115 | innerscore_dict.get(a))] * weight |
| 116 | return outerscore |
| 117 | else: return 0.0 |
| 118 | |
| 119 | def validate_string(s): |
| 120 | try: |