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

updated docs and notebooks to have a better structure

parent 9af65282
No related branches found
No related tags found
No related merge requests found
Pipeline #32348 passed
Showing
with 1754 additions and 260 deletions
...@@ -26,6 +26,7 @@ help: ...@@ -26,6 +26,7 @@ help:
cp ../examples/notebook_extra_features.ipynb source/ cp ../examples/notebook_extra_features.ipynb source/
cp ../examples/notebook_api_functionality.ipynb source/ cp ../examples/notebook_api_functionality.ipynb source/
cp ../examples/notebook_luminosity_function_single.ipynb source/ cp ../examples/notebook_luminosity_function_single.ipynb source/
cp ../examples/notebook_luminosity_function_binaries.ipynb source/
# Copy the badges # Copy the badges
cp -r ../badges/ source/ cp -r ../badges/ source/
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
%% Cell type:markdown id:879b596b-d70c-4f90-b668-563b4ad93ffc tags: %% Cell type:markdown id:879b596b-d70c-4f90-b668-563b4ad93ffc tags:
# Using custom logging routines with binarycpython # Using custom logging routines with binarycpython
In this notebook you'll learn how to use the custom logging functionality In this notebook you'll learn how to use the custom logging functionality
%% Cell type:code id:696ecbb9-1efd-48f4-a57e-2cf6dfe416f1 tags: %% Cell type:code id:696ecbb9-1efd-48f4-a57e-2cf6dfe416f1 tags:
``` python ``` python
from binarycpython import _binary_c_bindings from binarycpython import _binary_c_bindings
from binarycpython.utils.custom_logging_functions import ( from binarycpython.utils.custom_logging_functions import (
autogen_C_logging_code, autogen_C_logging_code,
binary_c_log_code, binary_c_log_code,
create_and_load_logging_function, create_and_load_logging_function,
) )
from binarycpython.utils.run_system_wrapper import run_system from binarycpython.utils.run_system_wrapper import run_system
from binarycpython.utils.grid import Population from binarycpython.utils.grid import Population
``` ```
%% Cell type:markdown id:d4d721cc-df4f-4ac2-b6f9-62e85ca0c1e5 tags: %% Cell type:markdown id:d4d721cc-df4f-4ac2-b6f9-62e85ca0c1e5 tags:
The custom logging functionality allows us to decide the output of binary_c _without_ modifying the actual sourcecode of binary_c (i.e. editing `src/logging/log_every_timestep` in binary_c). Rather, we can create a logging routine from within python. The custom logging functionality allows us to decide the output of binary_c _without_ modifying the actual sourcecode of binary_c (i.e. editing `src/logging/log_every_timestep` in binary_c). Rather, we can create a logging routine from within python.
Technically, the following steps are taken: Technically, the following steps are taken:
- User creates a logging print statement from within python - User creates a logging print statement from within python
- The logging print statement string gets wrapped into a proper c-function by `binary_c_log_code` - The logging print statement string gets wrapped into a proper c-function by `binary_c_log_code`
- The c-function string gets compiled and loaded into memory by `create_and_load_logging_function` - The c-function string gets compiled and loaded into memory by `create_and_load_logging_function`
- The memory adress of the compiled and loaded print function can now be passed to C - The memory adress of the compiled and loaded print function can now be passed to C
- binary_c uses the custom print function - binary_c uses the custom print function
The custom logging functionality can be used when running systems via `run_system()`, via `Population.evolve()` and `Population.evolve_single()`, and directly via the API The custom logging functionality can be used when running systems via `run_system()`, via `Population.evolve()` and `Population.evolve_single()`, and directly via the API
Within the logging statement we can access information from the stardata object, as well as use logical statements to determine when to log information. What we cannot do, however, is access functions that are not _publicly available_. For very elaborate printing routines it is still advised to actually hardcode the print statement into binary_c itself. Within the logging statement we can access information from the stardata object, as well as use logical statements to determine when to log information. What we cannot do, however, is access functions that are not _publicly available_. For very elaborate printing routines it is still advised to actually hardcode the print statement into binary_c itself.
%% Cell type:markdown id:be137151-bb57-43d7-bab1-0167512ac727 tags: %% Cell type:markdown id:be137151-bb57-43d7-bab1-0167512ac727 tags:
## Usage ## Usage
%% Cell type:markdown id:ac4e5f4c-81e6-4980-b852-aca84ca74f4c tags: %% Cell type:markdown id:ac4e5f4c-81e6-4980-b852-aca84ca74f4c tags:
There are two methods to create the C-code that will be compiled: There are two methods to create the C-code that will be compiled:
- Automatically generate the print statement and use the wrapper to generate the full function string, by using `autogen_C_logging_code` - Automatically generate the print statement and use the wrapper to generate the full function string, by using `autogen_C_logging_code`
- Create your custom print statement and use the wrapper to generate the full function string, by writing out the print statement. Here the logging statement obviously has to be valid C code - Create your custom print statement and use the wrapper to generate the full function string, by writing out the print statement. Here the logging statement obviously has to be valid C code
%% Cell type:code id:236cf821-09ac-4237-9b8f-6e36d2edf446 tags: %% Cell type:code id:236cf821-09ac-4237-9b8f-6e36d2edf446 tags:
``` python ``` python
# generate logging lines. Here you can choose whatever you want to have logged, and with what header # generate logging lines. Here you can choose whatever you want to have logged, and with what header
# this generates working print statements # this generates working print statements
logging_line = autogen_C_logging_code( logging_line = autogen_C_logging_code(
{ {
"MY_STELLAR_DATA": ["model.time", "star[0].mass"], "MY_STELLAR_DATA": ["model.time", "star[0].mass"],
} }
) )
print(logging_line) print(logging_line)
``` ```
%% Output %% Output
Printf("MY_STELLAR_DATA %g %g\n",((double)stardata->model.time),((double)stardata->star[0].mass)); Printf("MY_STELLAR_DATA %g %g\n",((double)stardata->model.time),((double)stardata->star[0].mass));
%% Cell type:code id:feb423d5-5cc3-433c-9801-f8017abbc03a tags: %% Cell type:code id:feb423d5-5cc3-433c-9801-f8017abbc03a tags:
``` python ``` python
# You can also decide to `write` your own logging_line, which allows you to write a more complex logging statement with conditionals. # You can also decide to `write` your own logging_line, which allows you to write a more complex logging statement with conditionals.
logging_line = 'Printf("MY_STELLAR_DATA time=%g mass=%g\\n", stardata->model.time, stardata->star[0].mass)' logging_line = 'Printf("MY_STELLAR_DATA time=%g mass=%g\\n", stardata->model.time, stardata->star[0].mass)'
print(logging_line) print(logging_line)
``` ```
%% Output %% Output
Printf("MY_STELLAR_DATA time=%g mass=%g\n", stardata->model.time, stardata->star[0].mass) Printf("MY_STELLAR_DATA time=%g mass=%g\n", stardata->model.time, stardata->star[0].mass)
%% Cell type:code id:2f5defbf-c623-49ed-a238-fba52a563a58 tags: %% Cell type:code id:2f5defbf-c623-49ed-a238-fba52a563a58 tags:
``` python ``` python
# Generate the entire 'script' by wrapping the logging line # Generate the entire 'script' by wrapping the logging line
custom_logging_code = binary_c_log_code(logging_line) custom_logging_code = binary_c_log_code(logging_line)
print(custom_logging_code) print(custom_logging_code)
``` ```
%% Output %% Output
#pragma push_macro("Max") #pragma push_macro("Max")
#pragma push_macro("Min") #pragma push_macro("Min")
#undef Max #undef Max
#undef Min #undef Min
#include "binary_c.h" #include "binary_c.h"
// add visibility __attribute__ ((visibility ("default"))) to it // add visibility __attribute__ ((visibility ("default"))) to it
void binary_c_API_function custom_output_function(struct stardata_t * stardata); void binary_c_API_function custom_output_function(struct stardata_t * stardata);
void binary_c_API_function custom_output_function(struct stardata_t * stardata) void binary_c_API_function custom_output_function(struct stardata_t * stardata)
{ {
// struct stardata_t * stardata = (struct stardata_t *)x; // struct stardata_t * stardata = (struct stardata_t *)x;
Printf("MY_STELLAR_DATA time=%g mass=%g\n", stardata->model.time, stardata->star[0].mass); Printf("MY_STELLAR_DATA time=%g mass=%g\n", stardata->model.time, stardata->star[0].mass);
} }
#undef Max #undef Max
#undef Min #undef Min
#pragma pop_macro("Min") #pragma pop_macro("Min")
#pragma pop_macro("Max") #pragma pop_macro("Max")
%% Cell type:markdown id:efa7f1e9-247e-4196-a883-bcff05265d02 tags: %% Cell type:markdown id:efa7f1e9-247e-4196-a883-bcff05265d02 tags:
Combining the above with e.g. run_system() (see notebook_individual_systems for more examples): Combining the above with e.g. run_system() (see notebook_individual_systems for more examples):
%% Cell type:code id:dcd74bbc-478b-43e4-b495-8c456e8d1d88 tags: %% Cell type:code id:dcd74bbc-478b-43e4-b495-8c456e8d1d88 tags:
``` python ``` python
# logging statement # logging statement
logging_line = 'Printf("MY_STELLAR_DATA time=%g mass=%g\\n", stardata->model.time, stardata->star[0].mass)' logging_line = 'Printf("MY_STELLAR_DATA time=%g mass=%g\\n", stardata->model.time, stardata->star[0].mass)'
# Entire script # Entire script
custom_logging_code = binary_c_log_code(logging_line) custom_logging_code = binary_c_log_code(logging_line)
# Run system # Run system
output = run_system(M_1=2, custom_logging_code=custom_logging_code) output = run_system(M_1=2, custom_logging_code=custom_logging_code)
# print (abridged) output # print (abridged) output
print("\n".join(output.splitlines()[:4])) print("\n".join(output.splitlines()[:4]))
``` ```
%% Output %% Output
MY_STELLAR_DATA time=0 mass=2 MY_STELLAR_DATA time=0 mass=2
MY_STELLAR_DATA time=0 mass=2 MY_STELLAR_DATA time=0 mass=2
MY_STELLAR_DATA time=1e-06 mass=2 MY_STELLAR_DATA time=1e-06 mass=2
MY_STELLAR_DATA time=2e-06 mass=2 MY_STELLAR_DATA time=2e-06 mass=2
%% Cell type:markdown id:1998ee8f-8c0a-462b-b1e0-54f5963902cc tags: %% Cell type:markdown id:1998ee8f-8c0a-462b-b1e0-54f5963902cc tags:
### Using custom logging with the population object ### Using custom logging with the population object
Custom logging can be used for a whole population by setting the print statement (so not the entire logging script) in `C_logging_code` Custom logging can be used for a whole population by setting the print statement (so not the entire logging script) in `C_logging_code`
%% Cell type:code id:77bd09b0-1a94-499d-97db-a1f991c67c12 tags: %% Cell type:code id:77bd09b0-1a94-499d-97db-a1f991c67c12 tags:
``` python ``` python
# Set up population # Set up population
pop = Population() pop = Population()
# Set some BSE parameters # Set some BSE parameters
pop.set( pop.set(
M_1=5 M_1=5
) )
# Example logging that prints only if the star is post main-sequence # Example logging that prints only if the star is post main-sequence
example_logging_string_post_MS = """ example_logging_string_post_MS = """
if(stardata->star[0].stellar_type>MS) if(stardata->star[0].stellar_type>MS)
{ {
Printf("EXAMPLE_ABOVE_MS %30.12e %g %g %g %g %d %d\\n", Printf("EXAMPLE_ABOVE_MS %30.12e %g %g %g %g %d %d\\n",
// //
stardata->model.time, // 1 stardata->model.time, // 1
stardata->star[0].mass, //2 stardata->star[0].mass, //2
stardata->previous_stardata->star[0].mass, //3 stardata->previous_stardata->star[0].mass, //3
stardata->star[0].radius, //4 stardata->star[0].radius, //4
stardata->previous_stardata->star[0].radius, //5 stardata->previous_stardata->star[0].radius, //5
stardata->star[0].stellar_type, //6 stardata->star[0].stellar_type, //6
stardata->previous_stardata->star[0].stellar_type //7 stardata->previous_stardata->star[0].stellar_type //7
); );
}; };
""" """
# Set the logging # Set the logging
pop.set( pop.set(
C_logging_code=example_logging_string_post_MS C_logging_code=example_logging_string_post_MS
) )
out = pop.evolve_single() out = pop.evolve_single()
# Print (abridged) output # Print (abridged) output
print('\n'.join(out.splitlines()[:4])) print('\n'.join(out.splitlines()[:4]))
``` ```
%% Output %% Output
EXAMPLE_ABOVE_MS 1.041660877905e+02 4.99198 4.99198 6.1357 6.1357 2 1 EXAMPLE_ABOVE_MS 1.044142002936e+02 4.99194 4.99194 6.13567 6.13567 2 1
EXAMPLE_ABOVE_MS 1.041662558619e+02 4.99198 4.99198 6.14057 6.1357 2 2 EXAMPLE_ABOVE_MS 1.044572277695e+02 4.99192 4.99194 7.51803 6.13567 2 2
EXAMPLE_ABOVE_MS 1.041662560111e+02 4.99198 4.99198 6.14057 6.14057 2 2 EXAMPLE_ABOVE_MS 1.044654032097e+02 4.99192 4.99192 7.81395 7.51803 2 2
EXAMPLE_ABOVE_MS 1.041662564579e+02 4.99198 4.99198 6.14059 6.14057 2 2 EXAMPLE_ABOVE_MS 1.045084306856e+02 4.99191 4.99192 9.57443 7.81395 2 2
%% Cell type:markdown id:93397ff3-9b71-470d-8bc4-08fe5b1a5dca tags: %% Cell type:markdown id:93397ff3-9b71-470d-8bc4-08fe5b1a5dca tags:
### Using custom logging when running directly from the API ### Using custom logging when running directly from the API
When running a system directly with the API we need to manually load the custom logging into memory (via `create_and_load_logging_function`) and pass the memory address to the binary_c binding via `_binary_c_bindings.run_system(argstring, custom_logging_func_memaddr=custom_logging_memaddr)` When running a system directly with the API we need to manually load the custom logging into memory (via `create_and_load_logging_function`) and pass the memory address to the binary_c binding via `_binary_c_bindings.run_system(argstring, custom_logging_func_memaddr=custom_logging_memaddr)`
%% Cell type:code id:30142286-34ce-433e-82c8-565e2160ff5b tags: %% Cell type:code id:30142286-34ce-433e-82c8-565e2160ff5b tags:
``` python ``` python
# generate logging lines # generate logging lines
logging_line = autogen_C_logging_code( logging_line = autogen_C_logging_code(
{ {
"MY_STELLAR_DATA": ["model.time", "star[0].mass"], "MY_STELLAR_DATA": ["model.time", "star[0].mass"],
} }
) )
# Generate code around logging lines # Generate code around logging lines
custom_logging_code = binary_c_log_code(logging_line) custom_logging_code = binary_c_log_code(logging_line)
# Generate library and get memaddr # Generate library and get memaddr
custom_logging_memaddr, shared_lib_filename = create_and_load_logging_function( custom_logging_memaddr, shared_lib_filename = create_and_load_logging_function(
custom_logging_code custom_logging_code
) )
# #
m1 = 15.0 # Msun m1 = 15.0 # Msun
m2 = 14.0 # Msun m2 = 14.0 # Msun
separation = 0 # 0 = ignored, use period separation = 0 # 0 = ignored, use period
orbital_period = 4530.0 # days orbital_period = 4530.0 # days
eccentricity = 0.0 eccentricity = 0.0
metallicity = 0.02 metallicity = 0.02
max_evolution_time = 15000 max_evolution_time = 15000
argstring = "binary_c M_1 {0:g} M_2 {1:g} separation {2:g} orbital_period {3:g} eccentricity {4:g} metallicity {5:g} max_evolution_time {6:g}".format( argstring = "binary_c M_1 {0:g} M_2 {1:g} separation {2:g} orbital_period {3:g} eccentricity {4:g} metallicity {5:g} max_evolution_time {6:g}".format(
m1, m1,
m2, m2,
separation, separation,
orbital_period, orbital_period,
eccentricity, eccentricity,
metallicity, metallicity,
max_evolution_time, max_evolution_time,
) )
output = _binary_c_bindings.run_system( output = _binary_c_bindings.run_system(
argstring, custom_logging_func_memaddr=custom_logging_memaddr argstring, custom_logging_func_memaddr=custom_logging_memaddr
) )
# print (abridged) output # print (abridged) output
print('\n'.join(output.splitlines()[:4])) print('\n'.join(output.splitlines()[:4]))
``` ```
%% Output %% Output
MY_STELLAR_DATA 0 15 MY_STELLAR_DATA 0 15
MY_STELLAR_DATA 0 15 MY_STELLAR_DATA 0 15
MY_STELLAR_DATA 1e-06 15 MY_STELLAR_DATA 1e-06 15
MY_STELLAR_DATA 2e-06 15 MY_STELLAR_DATA 2e-06 15
%% Cell type:markdown id:39c76b1d-d968-4eef-b5ae-2542ed9557c3 tags: %% Cell type:markdown id:39c76b1d-d968-4eef-b5ae-2542ed9557c3 tags:
## Examples of logging strings ## Examples of logging strings
Below are some examples of logging strings Below are some examples of logging strings
%% Cell type:markdown id:2ac4af72-6dab-4cc9-986e-5b5b1fa31b73 tags: %% Cell type:markdown id:2ac4af72-6dab-4cc9-986e-5b5b1fa31b73 tags:
### Compact object ### Compact object
This logging will print the timestep when the star becomes a compact object. After it does, we change the maximum time to be the current time, effectively terminating the evolution This logging will print the timestep when the star becomes a compact object. After it does, we change the maximum time to be the current time, effectively terminating the evolution
%% Cell type:code id:6f0edc65-a788-4706-a0c5-2ace030765ec tags: %% Cell type:code id:6f0edc65-a788-4706-a0c5-2ace030765ec tags:
``` python ``` python
example_logging_string_CO = """ example_logging_string_CO = """
if(stardata->star[0].stellar_type>=NS) if(stardata->star[0].stellar_type>=NS)
{ {
if (stardata->model.time < stardata->model.max_evolution_time) if (stardata->model.time < stardata->model.max_evolution_time)
{ {
Printf("EXAMPLE_LOG_CO %30.12e %g %g %g %g %d %d\\n", Printf("EXAMPLE_LOG_CO %30.12e %g %g %g %g %d %d\\n",
// //
stardata->model.time, // 1 stardata->model.time, // 1
stardata->star[0].mass, //2 stardata->star[0].mass, //2
stardata->previous_stardata->star[0].mass, //3 stardata->previous_stardata->star[0].mass, //3
stardata->star[0].radius, //4 stardata->star[0].radius, //4
stardata->previous_stardata->star[0].radius, //5 stardata->previous_stardata->star[0].radius, //5
stardata->star[0].stellar_type, //6 stardata->star[0].stellar_type, //6
stardata->previous_stardata->star[0].stellar_type //7 stardata->previous_stardata->star[0].stellar_type //7
); );
}; };
/* Kill the simulation to save time */ /* Kill the simulation to save time */
stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm; stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm;
}; };
""" """
# Entire script # Entire script
custom_logging_code = binary_c_log_code(example_logging_string_CO) custom_logging_code = binary_c_log_code(example_logging_string_CO)
# Run system # Run system
output = run_system(M_1=10, custom_logging_code=custom_logging_code) output = run_system(M_1=10, custom_logging_code=custom_logging_code)
# print (abridged) output # print (abridged) output
print("\n".join(output.splitlines()[:4])) print("\n".join(output.splitlines()[:4]))
``` ```
%% Output %% Output
SINGLE_STAR_LIFETIME 10 27.7358 SINGLE_STAR_LIFETIME 10 28.4838
EXAMPLE_LOG_CO 2.773581245005e+01 1.33524 9.19314 1.72498e-05 730.446 13 5 EXAMPLE_LOG_CO 2.848380621869e+01 1.33469 9.1865 1.72498e-05 724.338 13 5
%% Cell type:markdown id:51c51592-6406-43bd-a879-10ace64aaf28 tags: %% Cell type:markdown id:51c51592-6406-43bd-a879-10ace64aaf28 tags:
### Logging mass evolution and the supernova ### Logging mass evolution and the supernova
This logging code prints the mass evolution and the moment the star goes supernova This logging code prints the mass evolution and the moment the star goes supernova
%% Cell type:code id:8f58fdf9-3e76-4c18-a1c5-eed0980d4133 tags: %% Cell type:code id:8f58fdf9-3e76-4c18-a1c5-eed0980d4133 tags:
``` python ``` python
example_logging_string_CO = """ example_logging_string_CO = """
Printf("EXAMPLE_MASSLOSS %30.12e %g %g %g %d %g\\n", Printf("EXAMPLE_MASSLOSS %30.12e %g %g %g %d %g\\n",
// //
stardata->model.time, // 1 stardata->model.time, // 1
stardata->star[0].mass, //2 stardata->star[0].mass, //2
stardata->previous_stardata->star[0].mass, //3 stardata->previous_stardata->star[0].mass, //3
stardata->common.zero_age.mass[0], //4 stardata->common.zero_age.mass[0], //4
stardata->star[0].stellar_type, //5 stardata->star[0].stellar_type, //5
stardata->model.probability //6 stardata->model.probability //6
); );
if(stardata->star[0].SN_type != SN_NONE) if(stardata->star[0].SN_type != SN_NONE)
{ {
if (stardata->model.time < stardata->model.max_evolution_time) if (stardata->model.time < stardata->model.max_evolution_time)
{ {
if(stardata->pre_events_stardata != NULL) Printf("EXAMPLE_SN %30.12e " // 1
{ "%g %g %g %d " // 2-5
Printf("EXAMPLE_SN %30.12e " // 1 "%d %d %g %g " // 6-9
"%g %g %g %d " // 2-5 "%g %g\\n", // 10-13
"%d %d %g %g " // 6-9
"%g %g %g %g\\n", // 10-13 //
stardata->model.time, // 1
//
stardata->model.time, // 1 stardata->star[0].mass, //2
stardata->previous_stardata->star[0].mass, //3
stardata->star[0].mass, //2 stardata->common.zero_age.mass[0], //4
stardata->pre_events_stardata->star[0].mass, //3 stardata->star[0].SN_type, //5
stardata->common.zero_age.mass[0], //4
stardata->star[0].SN_type, //5 stardata->star[0].stellar_type, //6
stardata->previous_stardata->star[0].stellar_type, //7
stardata->star[0].stellar_type, //6 stardata->model.probability, //8
stardata->pre_events_stardata->star[0].stellar_type, //7 stardata->previous_stardata->star[0].core_mass[ID_core(stardata->previous_stardata->star[0].stellar_type)], // 9
stardata->model.probability, //8
stardata->pre_events_stardata->star[0].core_mass[ID_core(stardata->pre_events_stardata->star[0].stellar_type)], // 9 stardata->previous_stardata->star[0].core_mass[CORE_CO], // 10
stardata->previous_stardata->star[0].core_mass[CORE_He] // 11
stardata->pre_events_stardata->star[0].core_mass[CORE_CO], // 10 );
stardata->pre_events_stardata->star[0].core_mass[CORE_He], // 11
stardata->star[0].fallback, // 12
stardata->star[0].fallback_mass // 13
);
}
else
{
Printf("EXAMPLE_SN %30.12e " // 1
"%g %g %g %d " // 2-5
"%d %d %g %g " // 6-9
"%g %g %g %g\\n", // 10-13
//
stardata->model.time, // 1
stardata->star[0].mass, //2
stardata->previous_stardata->star[0].mass, //3
stardata->common.zero_age.mass[0], //4
stardata->star[0].SN_type, //5
stardata->star[0].stellar_type, //6
stardata->previous_stardata->star[0].stellar_type, //7
stardata->model.probability, //8
stardata->previous_stardata->star[0].core_mass[ID_core(stardata->previous_stardata->star[0].stellar_type)], // 9
stardata->previous_stardata->star[0].core_mass[CORE_CO], // 10
stardata->previous_stardata->star[0].core_mass[CORE_He], // 11
stardata->star[0].fallback, // 12
stardata->star[0].fallback_mass // 13
);
}
}; };
/* Kill the simulation to save time */ /* Kill the simulation to save time */
stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm; stardata->model.max_evolution_time = stardata->model.time - stardata->model.dtm;
}; };
""" """
# Entire script # Entire script
custom_logging_code = binary_c_log_code(example_logging_string_CO) custom_logging_code = binary_c_log_code(example_logging_string_CO)
# Run system # Run system
output = run_system(M_1=20, custom_logging_code=custom_logging_code) output = run_system(M_1=20, custom_logging_code=custom_logging_code)
# print (abridged) output # print (abridged) output
print("\n".join(output.splitlines()[-2:])) print("\n".join(output.splitlines()[-2:]))
``` ```
%% Output %% Output
EXAMPLE_MASSLOSS 9.878236827680e+00 1.61349 8.38063 20 13 1 EXAMPLE_MASSLOSS 1.050651207308e+01 1.59452 9.34213 20 13 1
EXAMPLE_SN 9.878236827680e+00 1.61349 8.38063 20 12 13 5 1 6.74037 4.92267 6.74037 0 0 EXAMPLE_SN 1.050651207308e+01 1.59452 9.34213 20 12 13 5 1 6.55458 4.71662 6.55458
%% Cell type:code id:484297c0-accb-4efc-a9c8-dbd2f32b89a6 tags:
``` python
```
......
This diff is collapsed.
docs/build/doctrees/nbsphinx/notebook_luminosity_function_binaries_20_1.png

55.8 KiB

This diff is collapsed.
docs/build/doctrees/nbsphinx/notebook_luminosity_function_single_20_1.png

24.4 KiB

docs/build/doctrees/nbsphinx/notebook_luminosity_function_single_26_1.png

23.3 KiB

docs/build/doctrees/nbsphinx/notebook_luminosity_function_single_34_0.png

30.1 KiB

This diff is collapsed.
No preview for this file type
No preview for this file type
File added
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