Skip to content
Snippets Groups Projects
Commit 8debe9a7 authored by Colm Talbot's avatar Colm Talbot
Browse files

update tests

parent e7c5cff9
No related branches found
No related tags found
1 merge request!491allow precessing BNS
Pipeline #61040 passed
...@@ -250,13 +250,6 @@ class TestConvertToLALParams(unittest.TestCase): ...@@ -250,13 +250,6 @@ class TestConvertToLALParams(unittest.TestCase):
def test_lambda_1(self): def test_lambda_1(self):
self._conversion_to_component_tidal(['lambda_1']) self._conversion_to_component_tidal(['lambda_1'])
def test_bns_spherical_spin_to_aligned(self):
self.parameters['a_1'] = -1
self.parameters['tilt_1'] = np.arccos(0.5)
chi_1 = self.parameters['a_1'] * np.cos(self.parameters['tilt_1'])
self.bns_convert()
self.assertEqual(self.parameters['chi_1'], chi_1)
class TestDistanceTransformations(unittest.TestCase): class TestDistanceTransformations(unittest.TestCase):
......
...@@ -47,11 +47,12 @@ class TestLalBNS(unittest.TestCase): ...@@ -47,11 +47,12 @@ class TestLalBNS(unittest.TestCase):
def setUp(self): def setUp(self):
self.parameters = dict( self.parameters = dict(
mass_1=1.4, mass_2=1.4, luminosity_distance=400.0, chi_1=0.4, mass_1=1.4, mass_2=1.4, luminosity_distance=400.0, a_1=0.4,
chi_2=0.3, theta_jn=1.7, phase=0.0, lambda_1=100.0, lambda_2=100.0) a_2=0.3, tilt_1=0.2, tilt_2=1.7, phi_jl=0.2, phi_12=0.9,
theta_jn=1.7, phase=0.0, lambda_1=100.0, lambda_2=100.0)
self.waveform_kwargs = dict( self.waveform_kwargs = dict(
waveform_approximant='TaylorF2', reference_frequency=50.0, waveform_approximant='IMRPhenomPv2_NRTidal',
minimum_frequency=20.0) reference_frequency=50.0, minimum_frequency=20.0)
self.frequency_array = bilby.core.utils.create_frequency_series(2048, 4) self.frequency_array = bilby.core.utils.create_frequency_series(2048, 4)
def tearDown(self): def tearDown(self):
...@@ -59,7 +60,7 @@ class TestLalBNS(unittest.TestCase): ...@@ -59,7 +60,7 @@ class TestLalBNS(unittest.TestCase):
del self.waveform_kwargs del self.waveform_kwargs
del self.frequency_array del self.frequency_array
def test_lal_bns_works_runs_valid_parameters(self): def test_lal_bns_runs_with_valid_parameters(self):
self.parameters.update(self.waveform_kwargs) self.parameters.update(self.waveform_kwargs)
self.assertIsInstance( self.assertIsInstance(
bilby.gw.source.lal_binary_neutron_star( bilby.gw.source.lal_binary_neutron_star(
...@@ -78,14 +79,6 @@ class TestLalBNS(unittest.TestCase): ...@@ -78,14 +79,6 @@ class TestLalBNS(unittest.TestCase):
bilby.gw.source.lal_binary_neutron_star( bilby.gw.source.lal_binary_neutron_star(
self.frequency_array, **self.parameters) self.frequency_array, **self.parameters)
def test_fails_without_aligned_spins(self):
self.parameters.pop('chi_1')
self.parameters.pop('chi_2')
self.parameters.update(self.waveform_kwargs)
with self.assertRaises(TypeError):
bilby.gw.source.lal_binary_neutron_star(
self.frequency_array, **self.parameters)
class TestEccentricLalBBH(unittest.TestCase): class TestEccentricLalBBH(unittest.TestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment