From 7514e9d6f1b9c7d5ffc0ff725f17896dac32ccad Mon Sep 17 00:00:00 2001 From: Sona Chitchyan Date: Wed, 9 Aug 2023 10:38:43 -0400 Subject: [PATCH] got rid of duplicate tests --- tardis/montecarlo/tests/test_montecarlo.py | 66 ------------------- tardis/transport/tests/test_doppler_factor.py | 1 - 2 files changed, 67 deletions(-) diff --git a/tardis/montecarlo/tests/test_montecarlo.py b/tardis/montecarlo/tests/test_montecarlo.py index 936a434a97f..8d932e25332 100644 --- a/tardis/montecarlo/tests/test_montecarlo.py +++ b/tardis/montecarlo/tests/test_montecarlo.py @@ -250,26 +250,6 @@ def test_unphysical_doppler_factor(mu, r, inv_t_exp): obtained = get_doppler_factor(r, mu, time_explosion) -@pytest.mark.parametrize( - ["mu", "r", "inv_t_exp", "expected"], - [ - (0.3, 7.5e14, 1 / 5.2e7, 1 / 0.9998556693818854), - (-0.3, 0, 1 / 2.6e7, 1.0), - (0, 1, 1 / 2.6e7, 1.0), - ], -) -def test_get_inverse_doppler_factor(mu, r, inv_t_exp, expected): - # Set the params from test cases here - # TODO: add relativity tests - time_explosion = 1 / inv_t_exp - - # Perform any other setups just before this, they can be additional calls - # to other methods or introduction of some temporary variables - - obtained = r_packet.get_inverse_doppler_factor(r, mu, time_explosion) - - # Perform required assertions - assert_almost_equal(obtained, expected) @pytest.mark.parametrize(["mu", "r", "inv_t_exp"], [(-0.3, 5, 1e10)]) @@ -284,52 +264,6 @@ def test_unphysical_inverse_doppler_factor(mu, r, inv_t_exp): obtained = r_packet.get_inverse_doppler_factor(r, mu, time_explosion) -@pytest.mark.parametrize( - ["mu", "r", "inv_t_exp", "expected"], - [ - (-0.3, 10000000, 0.001, 1.0000001000692842), - (-0.3, 0, 1 / 2.6e7, 1.0), - (0, 1, 1 / 2.6e7, 1.0), - ], -) -def test_get_doppler_factor_full_relativity(mu, r, inv_t_exp, expected): - # Set the params from test cases here - # TODO: add relativity tests - mc.full_relativity = True - time_explosion = 1 / inv_t_exp - - # Perform any other setups just before this, they can be additional calls - # to other methods or introduction of some temporary variables - - obtained = get_doppler_factor(r, mu, time_explosion) - mc.full_relativity = False - # Perform required assertions - assert_almost_equal(obtained, expected) - - -@pytest.mark.parametrize( - ["mu", "r", "inv_t_exp", "expected"], - [ - (-0.3, 10000000, 0.001, 0.999999899930827), - (-0.3, 0, 1 / 2.6e7, 1.0), - (0, 1, 1 / 2.6e7, 1.0), - ], -) -def test_get_inverse_doppler_factor_full_relativity(mu, r, inv_t_exp, expected): - # Set the params from test cases here - # TODO: add relativity tests - mc.full_relativity = True - time_explosion = 1 / inv_t_exp - - # Perform any other setups just before this, they can be additional calls - # to other methods or introduction of some temporary variables - - obtained = r_packet.get_inverse_doppler_factor(r, mu, time_explosion) - mc.full_relativity = False - # Perform required assertions - assert_almost_equal(obtained, expected) - - def test_get_random_mu_different_output(): """ Ensure that different calls results diff --git a/tardis/transport/tests/test_doppler_factor.py b/tardis/transport/tests/test_doppler_factor.py index c260251228f..fe8e64e6391 100644 --- a/tardis/transport/tests/test_doppler_factor.py +++ b/tardis/transport/tests/test_doppler_factor.py @@ -69,7 +69,6 @@ def test_get_doppler_factor_full_relativity(mu, beta, expected): ) def test_get_inverse_doppler_factor(mu, r, inv_t_exp, expected): # Set the params from test cases here - # TODO: add relativity tests time_explosion = 1 / inv_t_exp # Perform any other setups just before this, they can be additional calls