Skip to content

Commit

Permalink
added docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
sonachitchyan committed Aug 9, 2023
1 parent c806371 commit 11c8a31
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions tardis/transport/tests/test_doppler_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@
],
)
def test_get_doppler_factor(mu, r, inv_t_exp, expected):
"""
Checks the get_doppler_factor function.
Parameters
----------
mu : float
Angle of movement of the packet.
r : float
Radius of the position of the packet.
inv_t_exp : float
Inverse of t_explosion.
expected : float
Expected value of the doppler factor.
"""
# Set the params from test cases here
time_explosion = 1 / inv_t_exp

Expand All @@ -39,6 +53,18 @@ def test_get_doppler_factor(mu, r, inv_t_exp, expected):
],
)
def test_get_doppler_factor_partial_relativity(mu, beta, expected):
"""
Checks the get_doppler_factor_partial_relativity.
Parameters
----------
mu : float
Angle of movement of the packet.
beta : float
Velocity over speed of light for the packet.
expected : float
Expected value of the doppler factor.
"""
obtained = frame_transformations.get_doppler_factor_partial_relativity(
mu, beta
)
Expand All @@ -54,6 +80,18 @@ def test_get_doppler_factor_partial_relativity(mu, beta, expected):
],
)
def test_get_doppler_factor_full_relativity(mu, beta, expected):
"""
Checks the get_doppler_factor_full_relativity.
Parameters
----------
mu : float
Angle of movement of the packet.
beta : float
Velocity over speed of light for the packet.
expected : float
Expected value of the doppler factor.
"""
obtained = frame_transformations.get_doppler_factor_full_relativity(
mu, beta
)
Expand All @@ -69,6 +107,20 @@ def test_get_doppler_factor_full_relativity(mu, beta, expected):
],
)
def test_get_inverse_doppler_factor(mu, r, inv_t_exp, expected):
"""
Checks the get_inverse_doppler_factor function.
Parameters
----------
mu : float
Angle of movement of the packet.
r : float
Radius of the position of the packet.
inv_t_exp : float
Inverse of t_explosion.
expected : float
Expected value of the inverse doppler factor.
"""
# Set the params from test cases here
time_explosion = 1 / inv_t_exp

Expand All @@ -92,6 +144,18 @@ def test_get_inverse_doppler_factor(mu, r, inv_t_exp, expected):
],
)
def test_get_inverse_doppler_factor_partial_relativity(mu, beta, expected):
"""
Checks the get_inverse_doppler_factor_partial_relativity function.
Parameters
----------
mu : float
Angle of movement of the packet.
beta : float
Velocity over speed of light for the packet.
expected : float
Expected value of the inverse doppler factor.
"""
obtained = (
frame_transformations.get_inverse_doppler_factor_partial_relativity(
mu, beta
Expand All @@ -109,6 +173,18 @@ def test_get_inverse_doppler_factor_partial_relativity(mu, beta, expected):
],
)
def test_get_inverse_doppler_factor_full_relativity(mu, beta, expected):
"""
Checks the get_inverse_doppler_factor_full_relativity function.
Parameters
----------
mu : float
Angle of movement of the packet.
beta : float
Velocity over speed of light for the packet.
expected : float
Expected value of the inverse doppler factor.
"""
obtained = frame_transformations.get_inverse_doppler_factor_full_relativity(
mu, beta
)
Expand Down

0 comments on commit 11c8a31

Please sign in to comment.