diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py index 384a9c92448b71425bafafb5ab1fbbff31532716..baa5df9968c67fe2fe4b8e5f0d5981c2b213a9ec 100644 --- a/binarycpython/utils/grid.py +++ b/binarycpython/utils/grid.py @@ -38,7 +38,7 @@ from binarycpython.utils.functions import get_defaults, parse_binary_c_version_i # TODO: add functionality to return the nuclear_mass_list # TODO: add functionality to return the source_list # TODO: add functionality to return the ensemble_list -# TODO: add verbosity options +# DONE: add verbosity options # DONE: add functionality to return the evcode_version_string # Make this function also an API call. Doest seem to get written to a buffer that is stored into a python object. rather its just written to stdout diff --git a/binarycpython/utils/grid_options_defaults.py b/binarycpython/utils/grid_options_defaults.py index 5a747233d2e0674ecf77b15fc44435cf533f0d5b..69acd1c61eaf78a39f8dbbeb621670c0826a3e7c 100644 --- a/binarycpython/utils/grid_options_defaults.py +++ b/binarycpython/utils/grid_options_defaults.py @@ -7,6 +7,11 @@ grid_options_defaults_dict = { # general "amt_cores": 1, # total amount of cores used to evolve the population "verbose": 0, # Level of verbosity of the simulation + # binary_c files + "binary_c_executable": os.path.join(os.environ["BINARY_C"], "binary_c-config") # TODO: make this more robust + "binary_c_shared_library": os.path.join(os.environ["BINARY_C"], "src", "libbinary_c.so") # TODO: make this more robust + "binary_c_config_executable": os.path.join(os.environ["BINARY_C"], "binary_c-config")# TODO: make this more robust + # Output dir # "output_dir": # Custom logging @@ -34,6 +39,7 @@ grid_options_defaults_dict = { # Probability: "weight": 1.0, # weighting for the probability "repeat": 1.0, # number of times to repeat each system (probability is adjusted to be 1/repeat) + ## # return_array_refs=>1, # quicker data parsing mode # sort_args=>1, diff --git a/setup.py b/setup.py index 36a2278eee6b36974005a9bf6026e4048c4194ed..dd214f0ba785135ac4cde05643b75aedc1cffd6f 100644 --- a/setup.py +++ b/setup.py @@ -7,17 +7,19 @@ import subprocess import re import sys -# TODO: make this clean GSL_DIR = os.getenv("GSL_DIR", None) if not GSL_DIR: print( "Warning: GSL_DIR is not set, this might lead to errors along the installation if there is no other version of GSL in the include dirs" ) - # TODO: write code to know exact parent directory of this file. CWD = os.getcwd() +############################################################ +# Getting information from binary_c +############################################################ + # binary_c must be installed. binary_c_config = os.environ["BINARY_C"] + "/binary_c-config" @@ -61,11 +63,14 @@ for x in defines: y = lone.match(x) if y: binary_c_define_macros.extend([(y.group(1), None)]) + # add API header file API_h = os.environ["BINARY_C"] + "/src/API/binary_c_API.h" binary_c_define_macros.extend([("BINARY_C_API_H", API_h)]) -# +############################################################ +# Setting all directories and libraries to their final values +############################################################ include_dirs = ( [os.environ["BINARY_C"] + "/src", os.environ["BINARY_C"] + "/src/API", "include",] + binary_c_incdirs @@ -90,7 +95,6 @@ runtime_library_dirs = [ # os.path.join(CWD, "binarycpython/core/"), ] + binary_c_libdirs -# TODO: move the creeation of all the include stuff to here so its easier to print everything # print('\n') # print("binary_c_config: ", str(binary_c_config) + "\n") # print("incdirs: ", str(include_dirs) + "\n") @@ -103,6 +107,11 @@ runtime_library_dirs = [ # print("macros: ", str(binary_c_define_macros) + "\n") # print('\n') +############################################################ +# Making the extension function +############################################################ +# TODO: fix that this one also compiles the code itself + binary_c_python_api_module = Extension( # name="binarycpython.core.binary_c", name="binary_c_python_api", @@ -122,13 +131,16 @@ def readme(): with open("README.md") as f: return f.read() +############################################################ +# Making the extension function +############################################################ setup( name="binarycpython", - version="0.1", - description="This is a python API for binary_c by Rob Izzard and collaborators", - author="Jeff Andrews and Robert Izzard and David Hendriks", - author_email="andrews@physics.uoc.gr and r.izzard@surrey.ac.uk and rob.izzard@gmail.com and davidhendriks93@gmail.com", + version="0.2", + description="This is a python API for binary_c by David Hendriks, Rob Izzard and collaborators. Based on the initial set up by Jeff andrews", + author=" David Hendriks, Robert Izzard and Jeff Andrews", + author_email="davidhendriks93@gmail.com/d.hendriks@surrey.ac.uk, r.izzard@surrey.ac.uk/rob.izzard@gmail.com andrews@physics.uoc.gr", long_description=readme(), url="https://gitlab.eps.surrey.ac.uk/ri0005/binary_c-python", license="",