Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnitz committed Jun 26, 2023
1 parent 7a638f1 commit 2dcf4c7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/detector/loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# along with a longer name. Note that some of these are not physical detectors
# but may be useful for testing or study purposes

for abv, long_name in get_available_detectors():
for abv in get_available_detectors():
d = Detector(abv)

# Note that units are all in radians
print("{} {} Latitude {} Longitude {}".format(long_name, abv,
print("{} Latitude {} Longitude {}".format(abv,
d.latitude,
d.longitude))
6 changes: 4 additions & 2 deletions pycbc/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def gmst_accurate(gps_time):

def get_available_detectors():
""" List the available detectors """
return list(_ground_detectors.keys())
dets = list(_ground_detectors.keys())
dets += [a[0] for a in get_available_lal_detectors()]
return dets

def get_available_lal_detectors():
"""Return list of detectors known in the currently sourced lalsuite.
Expand Down Expand Up @@ -204,7 +206,7 @@ def __init__(self, detector_name, reference_time=1126259462.0):
using a slower but higher precision method.
"""
self.name = str(detector_name)

lal_detectors = [pfx for pfx, name in get_available_lal_detectors()]
if detector_name in get_available_detectors():
self.info = _ground_detectors[detector_name]
Expand Down
2 changes: 1 addition & 1 deletion test/test_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
class TestDetector(unittest.TestCase):
def setUp(self):
self.d = [det.Detector(ifo)
for ifo, name in det.get_available_detectors()]
for ifo in det.get_available_detectors()]

# not distributed sanely, but should provide some good coverage
N = 1000
Expand Down
1 change: 0 additions & 1 deletion test/test_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def fill_sim_inspiral_row(self, row):
class TestInjection(unittest.TestCase):
def setUp(self):
available_detectors = get_available_detectors()
available_detectors = [a[0] for a in available_detectors]
self.assertTrue('H1' in available_detectors)
self.assertTrue('L1' in available_detectors)
self.assertTrue('V1' in available_detectors)
Expand Down

0 comments on commit 2dcf4c7

Please sign in to comment.