Skip to content

Commit

Permalink
last little coverage fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TomWagg committed Nov 6, 2023
1 parent 43f4f8f commit 1ef1e42
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cogsworth/tests/test_pop.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def test_io(self):
p_loaded = pop.load("testing-pop-io")

self.assertTrue(np.all(p.bpp == p_loaded.bpp))
self.assertTrue(np.all(p.final_pos == p_loaded.final_pos))
self.assertTrue(np.all(p.orbits[0].pos == p_loaded.orbits[0].pos))

# attempt overwrite without setting flag
Expand All @@ -58,13 +59,13 @@ def test_io(self):

def test_orbit_storage(self):
"""Test that we can control how orbits are stored"""
p = pop.Population(2, processes=1, store_entire_orbits=True)
p = pop.Population(20, final_kstar1=[13, 14], processes=1, store_entire_orbits=True)
p.create_population()

first_orbit = p.orbits[0][0] if isinstance(p.orbits[0], list) else p.orbits[0]
self.assertTrue(first_orbit.shape[0] >= 1)

p = pop.Population(2, processes=1, store_entire_orbits=False)
p = pop.Population(20, final_kstar1=[13, 14], processes=1, store_entire_orbits=False)
p.create_population()

first_orbit = p.orbits[0][0] if isinstance(p.orbits[0], list) else p.orbits[0]
Expand Down Expand Up @@ -112,6 +113,13 @@ def test_interface(self):
p.observables["G_app_1"].iloc[0] = 18.0
p.get_gaia_observed_bin_nums(ra="auto", dec="auto")

it_worked = True
try:
p.get_healpix_inds()
except ValueError:
it_worked = False
self.assertFalse(it_worked)

p.plot_map(ra="auto", dec="auto", coord="C", show=False)
p.plot_map(ra="auto", dec="auto", coord="G", show=False)

Expand Down Expand Up @@ -316,6 +324,7 @@ def test_bin_nums(self):
p._bin_nums = None

p.perform_stellar_evolution()
p._final_bpp = None
p.bin_nums
p._bin_nums = None

Expand Down

0 comments on commit 1ef1e42

Please sign in to comment.