Skip to content
Snippets Groups Projects
Commit 2cb7694e authored by David Hendriks's avatar David Hendriks
Browse files

added tests for grid

parent 3fbea66f
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ import datetime
from binarycpython.utils.grid import Population
from binarycpython.utils.functions import temp_dir
from binarycpython.utils.custom_logging_functions import binary_c_log_code
binary_c_temp_dir = temp_dir()
......@@ -350,6 +351,39 @@ class test_Population(unittest.TestCase):
self.assertTrue(argdict["M_1"] == 10)
self.assertTrue(argdict["metallicity"] == 0.02)
def test_evolve_single(self):
"""
Unittests for the function evolve_single
"""
CUSTOM_LOGGING_STRING_MASSES = """
Printf("MASS_PLOTTING %30.12e %g %g %g %g\\n",
//
stardata->model.time, // 1
// masses
stardata->common.zero_age.mass[0], //
stardata->common.zero_age.mass[1], //
stardata->star[0].mass,
stardata->star[1].mass
);
"""
test_pop = Population()
test_pop.set(M_1=10, M_2=5, orbital_period=100000, metallicty=0.02, max_evolution_time = 15000)
custom_logging_code = binary_c_log_code(
CUSTOM_LOGGING_STRING_MASSES
)
test_pop.set(custom_logging_code=custom_logging_code)
output = test_pop.evolve_single()
print(output)
if __name__ == "__main__":
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment