Loading binarycpython/utils/custom_logging_functions.py +20 −22 Original line number Diff line number Diff line Loading @@ -85,9 +85,8 @@ def binary_c_log_code(code: str, verbose: int=0) -> str: Function to construct the code to construct the custom logging function Example: Code to log and terminate evolution when the primary star becomes a NS Code to log and terminate evolution when the primary star becomes a NS:: :: if(stardata->star[0].stellar_type>=NS) { if (stardata->model.time < stardata->model.max_evolution_time) Loading Loading @@ -116,7 +115,6 @@ def binary_c_log_code(code: str, verbose: int=0) -> str: Returns: string containing the custom logging code. This includes all the includes and other definitions. This code will be used as the shared library """ verbose_print("Creating the code for the shared library for the custom logging", verbose, 0) Loading binarycpython/utils/plot_functions.py +24 −23 Original line number Diff line number Diff line Loading @@ -102,21 +102,21 @@ def plot_HR_diagram( log temperature on x axis (reversed) requires: time stellar_type_1 stellar_type_2 radius_1 radius_2 luminosity_1 luminosity_2 - time - stellar_type_1 - stellar_type_2 - radius_1 - radius_2 - luminosity_1 - luminosity_2 Plots: luminosity_1 vs teff_1 luminosity_2 vs teff_2 - luminosity_1 vs teff_1 - luminosity_2 vs teff_2 Tasks: TODO: add HD limit TODO: add lines of constant radius - TODO: add HD limit - TODO: add lines of constant radius Args: df: pandas dataframe with the required columns Loading Loading @@ -296,7 +296,7 @@ def plot_masses(df, show_stellar_types: bool=False, show_plot: bool=True): - Pms mass 1 - pms mass 2 - pms total mass (maybe?) core and env masses - (maybe?) core and env masses Args: df: pandas dataframe with the required columns Loading Loading @@ -505,25 +505,26 @@ def plot_system(plot_type, **kwargs): - plot is shown or returned. There are several pre-set plots to choose from: mass_evolution orbit_evolution hr_diagram - mass_evolution - orbit_evolution - hr_diagram Tasks: TODO: Complex Function! TODO: make sure this way of passing args works correctly. TODO: make the plotting specific keywords available via the inspect stuff - TODO: Complex Function! - TODO: make sure this way of passing args works correctly. - TODO: make the plotting specific keywords available via the inspect stuff All keywords are considered kwargs, except for plot_type Args: plot_type: string input should be one of the following types: ['mass_evolution', 'orbit_evolution', 'hr_diagram']. Input will be matched against this, and then go through a dictionary to pick the correct plotting function. plot_type: string input should be one of ['mass_evolution', 'orbit_evolution', 'hr_diagram']. Input will be matched against this, and then go through a dictionary to pick the correct plotting function. return_fig: boolean whether to return the fig object instead of plotting the plot (makes so that you can customize it) show_stellar_types: whether to plot the stellar type evolution on a second pane. This is not included in all the plotting routines. Other input: other kwargs that are passed to run_system (inspect the docstring of run_system for more info) Loading binarycpython/utils/run_system_wrapper.py +7 −6 Original line number Diff line number Diff line Loading @@ -20,18 +20,19 @@ def run_system(**kwargs): Function that runs a system. Mostly as a useful utility function that handles all the setup of argument lists etc. examples: * run_system(M_1=10): will run a system with ZAMS mass 1 = 10 * run_system(M_1=10, log_filename="~/example_log.txt"): Will run a system Examples: - run_system(M_1=10): will run a system with ZAMS mass 1 = 10 - run_system(M_1=10, log_filename="~/example_log.txt"): Will run a system and write the logfile too * run_system(M_1=10, parse_function=fancy_parsing_function) - run_system(M_1=10, parse_function=fancy_parsing_function) Tasks: TODO: Expand functionality. TODO: Notify user when an unknown keyword is passed. - TODO: Expand functionality. - TODO: Notify user when an unknown keyword is passed. All~ the arguments known to binary_c can be passed to this function as kwargs. Several extra arguments can be passed through the kwargs: Kwargs: custom_logging_code (string): Should contain a string containing the c-code for the shared library. If this is provided binary_c will use that custom logging code to output its data Loading Loading
binarycpython/utils/custom_logging_functions.py +20 −22 Original line number Diff line number Diff line Loading @@ -85,9 +85,8 @@ def binary_c_log_code(code: str, verbose: int=0) -> str: Function to construct the code to construct the custom logging function Example: Code to log and terminate evolution when the primary star becomes a NS Code to log and terminate evolution when the primary star becomes a NS:: :: if(stardata->star[0].stellar_type>=NS) { if (stardata->model.time < stardata->model.max_evolution_time) Loading Loading @@ -116,7 +115,6 @@ def binary_c_log_code(code: str, verbose: int=0) -> str: Returns: string containing the custom logging code. This includes all the includes and other definitions. This code will be used as the shared library """ verbose_print("Creating the code for the shared library for the custom logging", verbose, 0) Loading
binarycpython/utils/plot_functions.py +24 −23 Original line number Diff line number Diff line Loading @@ -102,21 +102,21 @@ def plot_HR_diagram( log temperature on x axis (reversed) requires: time stellar_type_1 stellar_type_2 radius_1 radius_2 luminosity_1 luminosity_2 - time - stellar_type_1 - stellar_type_2 - radius_1 - radius_2 - luminosity_1 - luminosity_2 Plots: luminosity_1 vs teff_1 luminosity_2 vs teff_2 - luminosity_1 vs teff_1 - luminosity_2 vs teff_2 Tasks: TODO: add HD limit TODO: add lines of constant radius - TODO: add HD limit - TODO: add lines of constant radius Args: df: pandas dataframe with the required columns Loading Loading @@ -296,7 +296,7 @@ def plot_masses(df, show_stellar_types: bool=False, show_plot: bool=True): - Pms mass 1 - pms mass 2 - pms total mass (maybe?) core and env masses - (maybe?) core and env masses Args: df: pandas dataframe with the required columns Loading Loading @@ -505,25 +505,26 @@ def plot_system(plot_type, **kwargs): - plot is shown or returned. There are several pre-set plots to choose from: mass_evolution orbit_evolution hr_diagram - mass_evolution - orbit_evolution - hr_diagram Tasks: TODO: Complex Function! TODO: make sure this way of passing args works correctly. TODO: make the plotting specific keywords available via the inspect stuff - TODO: Complex Function! - TODO: make sure this way of passing args works correctly. - TODO: make the plotting specific keywords available via the inspect stuff All keywords are considered kwargs, except for plot_type Args: plot_type: string input should be one of the following types: ['mass_evolution', 'orbit_evolution', 'hr_diagram']. Input will be matched against this, and then go through a dictionary to pick the correct plotting function. plot_type: string input should be one of ['mass_evolution', 'orbit_evolution', 'hr_diagram']. Input will be matched against this, and then go through a dictionary to pick the correct plotting function. return_fig: boolean whether to return the fig object instead of plotting the plot (makes so that you can customize it) show_stellar_types: whether to plot the stellar type evolution on a second pane. This is not included in all the plotting routines. Other input: other kwargs that are passed to run_system (inspect the docstring of run_system for more info) Loading
binarycpython/utils/run_system_wrapper.py +7 −6 Original line number Diff line number Diff line Loading @@ -20,18 +20,19 @@ def run_system(**kwargs): Function that runs a system. Mostly as a useful utility function that handles all the setup of argument lists etc. examples: * run_system(M_1=10): will run a system with ZAMS mass 1 = 10 * run_system(M_1=10, log_filename="~/example_log.txt"): Will run a system Examples: - run_system(M_1=10): will run a system with ZAMS mass 1 = 10 - run_system(M_1=10, log_filename="~/example_log.txt"): Will run a system and write the logfile too * run_system(M_1=10, parse_function=fancy_parsing_function) - run_system(M_1=10, parse_function=fancy_parsing_function) Tasks: TODO: Expand functionality. TODO: Notify user when an unknown keyword is passed. - TODO: Expand functionality. - TODO: Notify user when an unknown keyword is passed. All~ the arguments known to binary_c can be passed to this function as kwargs. Several extra arguments can be passed through the kwargs: Kwargs: custom_logging_code (string): Should contain a string containing the c-code for the shared library. If this is provided binary_c will use that custom logging code to output its data Loading