Skip to content

Commit

Permalink
got rid of duplicate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sonachitchyan committed Aug 9, 2023
1 parent 51ffe54 commit 7514e9d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 67 deletions.
66 changes: 0 additions & 66 deletions tardis/montecarlo/tests/test_montecarlo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion tardis/transport/tests/test_doppler_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7514e9d

Please sign in to comment.