Skip to content

Commit

Permalink
Merge branch 'sybenzvi/csv-to-sql' of github.com:SNEWS2/SNEWS_Coincid…
Browse files Browse the repository at this point in the history
…ence_System into sybenzvi/csv-to-sql
  • Loading branch information
KaraMelih committed Aug 14, 2024
2 parents 61a8d27 + 7b3ba28 commit 486f316
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions snews_cs/cs_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

def ncr(n, r):
f = math.factorial
# if the HB cache is empty, n-r returns negative number for which factorial is not defined
# as a temporary fix, let's return 0
if n-r < 0:
return 0
return int(f(n) / f(r) / f(n - r))

def cache_false_alarm_rate(cache_sub_list, hb_cache):
Expand Down

0 comments on commit 486f316

Please sign in to comment.