diff --git a/examples/examples_custom_logging.py b/examples/examples_custom_logging.py index 1cbe9af5bd0c7c21feac63be759d065971864702..b6dd5e8baec1bfff439463980c8cf212e057ff47 100644 --- a/examples/examples_custom_logging.py +++ b/examples/examples_custom_logging.py @@ -9,28 +9,20 @@ from binarycpython.utils.custom_logging_functions import ( from binarycpython.utils.grid import Population ################################################# +# File containing examples for the custom logging +# I'll put several logging snippets for different purposes in this file # - ################################################# # no logging set. pop = Population() -pop.set( - M_1=10, - M_2=10, - separation=0, - orbital_period=4530, - eccentricity=0, - metallicity=0.02, - max_evolution_time=15000, -) +pop.set(M_1=10, M_2=10, separation=0, orbital_period=4530, eccentricity=0, metallicity=0.02, max_evolution_time=15000) out = pop.evolve_single() print(out) ################################################# -# Example logging snippet for logging -pop.set( - C_logging_code=""" +# Example logging snippet for logging +pop.set(C_logging_code=""" if(stardata->star[0].stellar_type>=MS) { if (stardata->model.time < stardata->model.max_evolution_time) @@ -54,25 +46,15 @@ pop.set( /* Kill the simulation to save time */ //stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm; }; -""" -) +""") out = pop.evolve_single() print(out) ################################################# # Example logging snippet for checking whether the system becomes a NS, and stop the evolution if so. -pop.set( - M_1=100, - M_2=10, - separation=0, - orbital_period=400530, - eccentricity=0, - metallicity=0.002, - max_evolution_time=15000, -) -pop.set( - C_logging_code=""" +pop.set(M_1=100, M_2=10, separation=0, orbital_period=400530, eccentricity=0, metallicity=0.002, max_evolution_time=15000) +pop.set(C_logging_code=""" if(stardata->star[0].stellar_type>=NS) { if (stardata->model.time < stardata->model.max_evolution_time) @@ -94,13 +76,12 @@ pop.set( /* Kill the simulation to save time */ stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm; }; -""" -) +""") out = pop.evolve_single() -# TODO: add function that shows a +# TODO: add function that shows a # TODO: add function for compact object mergers -# TODO: add function +# TODO: add function \ No newline at end of file