diff --git a/binarycpython/utils/functions.py b/binarycpython/utils/functions.py index cb3f41249be10561474abee2d13dedfb736f538c..f5ebd8729762a2581a4b1c21b79e8bdeeefde0f8 100644 --- a/binarycpython/utils/functions.py +++ b/binarycpython/utils/functions.py @@ -178,7 +178,6 @@ def create_arg_string(arg_dict): arg_string = arg_string.strip() return arg_string - def get_defaults(filter_values=False): """ Function that calls the binaryc get args function and cast it into a dictionary diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py index eb8a6dc1d2da029a15508a702cd23aeb5e840b06..ba5f677c70305f01617802cea6375a56110fdd27 100644 --- a/binarycpython/utils/grid.py +++ b/binarycpython/utils/grid.py @@ -205,16 +205,26 @@ class Population(object): return options - def return_binary_c_version_info(self): + def return_binary_c_version_info(self, parsed=False): """ Function that returns the version information of binary_c TODO: Put in a nice dict. """ - version_info = binary_c_python_api.return_version_info() + version_info = binary_c_python_api.return_version_info().strip() - return version_info.strip() + if parsed: + version_info = parse_binary_c_version_info(version_info) + + return version_info + + def parse_binary_c_version_info(self): + """ + Function that parses the output of the version info that binary_c gives. This again is alot of string manipulation. Sensitive to breaking somewhere along the line. + """ + # TODO: write parsing function + pass def return_binary_c_defaults(self): """ @@ -342,6 +352,7 @@ class Population(object): self.grid_options["store_memaddr"] = binary_c_python_api.return_store("") # Execute. + # TODO: CHange this part alot. This is not finished whatsoever out = binary_c_python_api.run_population( self.return_argline(), self.grid_options["custom_logging_func_memaddr"], @@ -409,4 +420,4 @@ class Population(object): print(output) -################################################################################################ +################################################################################################ \ No newline at end of file diff --git a/tests/function_tests.py b/tests/function_tests.py index 1e0c77c2fe510d7d0b3553efe01bcba1661b0a4b..9e42273a94cd90ddb672ed1c74953dd80c3824bf 100644 --- a/tests/function_tests.py +++ b/tests/function_tests.py @@ -1,6 +1,7 @@ from binarycpython.utils.functions import ( get_help_super, - get_help_all + get_help_all, + get_help ) ############################# @@ -12,4 +13,5 @@ from binarycpython.utils.functions import ( ## Help functionality print(get_help_super(print_help=True, return_dict=False, fail_silently=False)) print(get_help_all(print_help=True)) +print(get_help('M_1')) # \ No newline at end of file diff --git a/tests/population/grid_tests.py b/tests/population/grid_tests.py index f256783602dbf70079272f02ccb3ae25906856eb..66dd4b29052b30dee92e0c1edfe4821420103fbe 100644 --- a/tests/population/grid_tests.py +++ b/tests/population/grid_tests.py @@ -39,8 +39,10 @@ test_pop.set( # test_pop.return_argline() ## return version info -# version_info = test_pop.return_binary_c_version_info() -# print(version_info) +version_info = test_pop.return_binary_c_version_info() +print(version_info) + +quit() ## Use custom arg file # test_pop.evolve_population(custom_arg_file='/home/david/projects/binary_c_root/binary_c-python/tests/population/custom_arg_file.txt')