@@ -12,12 +12,24 @@ from binarycpython.utils.custom_logging_functions import (
defrun_system(**kwargs):
"""
Wrapper to run a system with settings
Function that runs a system. Mostly as a useful utility function that handles all the setup of argument lists etc.
All~ the arguments known to binary_c can be passed to this function as kwargs.
Several extra arguments can be passed through the 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
* log_filename (string): Should contain name of the binary_c system logfile.
Passing this will make sure that the filename gets written for a run (its default behaviour is NOT to write a logfile for a system)
* parse_function (function): should contain a function that parses the output. The parse function should take 1 required parameter: the output of the binaryc run
Passing this will call the parse_function by passing it the output of the binary_c call and returns what the parse_function returns
This function determines which underlying python-c api function will be called based upon the arguments that are passed via kwargs.
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 to