(self, other)
| 99 | self.sigma_ = float(sigma) |
| 100 | |
| 101 | def Compare(self, other): |
| 102 | if self.units_ != other.units_: |
| 103 | print ("Incompatible units: %s and %s" % (self.units_, other.units_)) |
| 104 | sys.exit(1) |
| 105 | |
| 106 | significant = False |
| 107 | notable = 0 |
| 108 | percentage_string = "" |
| 109 | # compute notability and significance. |
| 110 | if self.units_ == "score": |
| 111 | compare_num = 100*self.result_/other.result_ - 100 |
| 112 | else: |
| 113 | compare_num = 100*other.result_/self.result_ - 100 |
| 114 | if abs(compare_num) > 0.1: |
| 115 | percentage_string = "%3.1f" % (compare_num) |
| 116 | z = Statistics.ComputeZ(other.result_, other.sigma_, |
| 117 | self.result_, self.count_) |
| 118 | p = Statistics.ComputeProbability(z) |
| 119 | if p < PROBABILITY_CONSIDERED_SIGNIFICANT: |
| 120 | significant = True |
| 121 | if compare_num >= PERCENT_CONSIDERED_SIGNIFICANT: |
| 122 | notable = 1 |
| 123 | elif compare_num <= -PERCENT_CONSIDERED_SIGNIFICANT: |
| 124 | notable = -1 |
| 125 | return ResultsDiff(significant, notable, percentage_string) |
| 126 | |
| 127 | def result(self): |
| 128 | return self.result_ |
no test coverage detected