Skip to content

Commit

Permalink
add unit test in response to #351
Browse files Browse the repository at this point in the history
  • Loading branch information
sblunt committed Mar 18, 2024
1 parent b3567c7 commit a4c6ab0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/test_secondary_rvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pandas import DataFrame

from orbitize.kepler import calc_orbit
from orbitize import read_input, system, sampler
from orbitize import read_input, system, sampler, DATADIR


def test_secondary_rv_lnlike_calc():
Expand Down Expand Up @@ -64,6 +64,16 @@ def test_secondary_rv_lnlike_calc():

assert np.all(rv0 == -m1 / m0 * rv1)

def test_read_input():
"""
Test that reading in a data file with only a companion RV and relative astrometry
works. Added in response to issue #351.
"""

input_data = read_input.read_file('{}/HD4747.csv'.format(DATADIR))
input_data['object'] = 1 # make sure all astrometry and RV is marked as of the secondary
mySystem = system.System(1, input_data, 1, 1, fit_secondary_mass=False)

if __name__ == "__main__":
test_secondary_rv_lnlike_calc()
# test_secondary_rv_lnlike_calc()
test_read_input()

0 comments on commit a4c6ab0

Please sign in to comment.