Skip to content

Commit

Permalink
Fix & enable unit tests for injection and frame (gwastro#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
titodalcanton authored and ahnitz committed Aug 19, 2016
1 parent 1d8fb91 commit 113a278
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 1 addition & 3 deletions test/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@

import pycbc
import unittest
from pycbc.types import *
from pycbc.scheme import *
import pycbc.frame
import numpy
import lal
#from pylal import Fr
from pycbc.types import TimeSeries
from utils import parse_args_cpu_only, simple_exit

# Frame tests only need to happen on the CPU
Expand Down
4 changes: 2 additions & 2 deletions test/test_injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
class MyInjection(object):
def fill_sim_inspiral_row(self, row):
# using dummy values for many fields, should work for our purposes
row.waveform = 'TaylorT4'
row.waveform = 'TaylorT4threePointFivePN'
row.distance = self.distance
total_mass = self.mass1 + self.mass2
row.mass1 = self.mass1
Expand Down Expand Up @@ -140,7 +140,7 @@ def test_injection_presence(self):
# FIXME could test amplitude and time more precisely
self.assertTrue(max_amp > 0 and max_amp < 1e-10)
time_error = ts.sample_times.numpy()[max_loc] - inj.end_time
self.assertTrue(abs(time_error) < 1.5 * self.earth_time)
self.assertTrue(abs(time_error) < 2 * self.earth_time)

def test_injection_absence(self):
"""Verify absence of signals outside known injection times"""
Expand Down
8 changes: 4 additions & 4 deletions tools/run_travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ test $? -ne 0 && RESULT=1
#python test/test_fft_unthreaded.py
#test $? -ne 0 && RESULT=1

#python test/test_frame.py
#test $? -ne 0 && RESULT=1
python test/test_frame.py
test $? -ne 0 && RESULT=1

python test/test_frequencyseries.py
test $? -ne 0 && RESULT=1

#python test/test_injection.py
#test $? -ne 0 && RESULT=1
python test/test_injection.py
test $? -ne 0 && RESULT=1

python test/test_matchedfilter.py
test $? -ne 0 && RESULT=1
Expand Down

0 comments on commit 113a278

Please sign in to comment.