Skip to content

Commit

Permalink
Merge pull request #886 from GeorgePantelakis/fixing-binom-test-results
Browse files Browse the repository at this point in the history
Fixed the support of the legacy scipy.stats.binom_test function
  • Loading branch information
GeorgePantelakis committed Nov 9, 2023
2 parents a51d43d + 153e5a2 commit a2d1236
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tlsfuzzer/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1679,21 +1679,23 @@ def analyze_bit_sizes(self):
passed += 1
total += 1

statistic = None
pvalue = None
try:
results = stats.binomtest(
passed, total, p=0.5, alternative="two-sided"
)
statistic = results.statistic
pvalue = results.pvalue
except AttributeError:
results = stats.binom_test(
passed, total, p=0.5, alternative="two-sided"
)
pvalue = results

output_files['sign_test'].write(
"K size of {0}: successes={1}, n={2}, stats={3}, pvalue={4}\n"\
.format(
k_size, passed, total,
results.statistic, results.pvalue
)
.format(k_size, passed, total, statistic, pvalue)
)

# Paired t-test
Expand Down

0 comments on commit a2d1236

Please sign in to comment.