Skip to content

Commit

Permalink
Fix typo, fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Nov 25, 2024
1 parent 372457c commit cbd9784
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/all_sky_search/pycbc_coinc_statmap
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,13 @@ if fore_locs.sum() > 0:
fap = 1 - numpy.exp(- coinc_time / ifar)
f['foreground/ifar'] = conv.sec_to_year(ifar)
f['foreground/fap'] = fap
for key, value in sig_info.itemns():
for key, value in sig_info.items():
f['foreground'].attrs[key] = value
ifar_exc = 1. / fg_far_exc
fap_exc = 1 - numpy.exp(- coinc_time_exc / ifar_exc)
f['foreground/ifar_exc'] = conv.sec_to_year(ifar_exc)
f['foreground/fap_exc'] = fap_exc
for key, value in exc_sig_info.itemns():
for key, value in exc_sig_info.items():
f['foreground'].attrs[key + '_exc'] = value
else:
f['foreground/ifar'] = ifar = numpy.array([])
Expand Down
5 changes: 4 additions & 1 deletion test/test_significance_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def setUp(self):
method_dict['fit_threshold'] = None if not function else 0

def meth_test(self, md=method_dict):
bg_n_louder, fg_n_louder = significance.get_n_louder(
bg_n_louder, fg_n_louder, sig_info = significance.get_n_louder(
self.test_bg_stat,
self.test_fg_stat,
self.dec_facs,
Expand Down Expand Up @@ -207,6 +207,9 @@ def meth_test(self, md=method_dict):
self.assertTrue(np.array_equal(fg_n_louder[fore_stat_sort],
fg_n_louder[fore_far_sort][::-1]))

# Tests on the significance info output dictionary
self.assertTrue(isinstance(sig_info, dict))

setattr(SignificanceMethodTest,
'test_%s_%s' % (method, function),
meth_test)
Expand Down

0 comments on commit cbd9784

Please sign in to comment.