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

added tests and updated version info parser

parent 907b6f38
No related branches found
No related tags found
No related merge requests found
# /user/HS128/dh00601/.config/tmuxinator/binaryc.yml
name: binarycpython
root: <%= ENV["BINARYC_PYTHON"] %>
windows:
- binarycpython:
layout: tiled
panes:
- ls
- subl .
- cd $BINARYC_DIR/
- cd $BINARYC_DATA_ROOT/
\ No newline at end of file
...@@ -155,90 +155,163 @@ def parse_binary_c_version_info(version_info_string): ...@@ -155,90 +155,163 @@ def parse_binary_c_version_info(version_info_string):
version_info_dict = {} version_info_dict = {}
for line in version_info_string.splitlines(): # Clean data and put in correct shape
line = line.strip() splitted = version_info_string.strip().splitlines()
if line == "": cleaned = set([el.strip() for el in splitted if not el == ""])
continue
if " is " in line: ##########################
split = line.split(" is ") # Isotopes:
version_info_dict[split[0].strip()] = split[1].strip() # Split off
else: isotopes = set([el for el in cleaned if el.startswith('Isotope ')])
if line.startswith("Binary_c/nucsyn"): cleaned = cleaned - isotopes
version_info_dict["intro"] = line
elif line.startswith("Email"): isotope_dict = {}
emails = line.split("Email ")[1].split(",") for el in isotopes:
cleaned_emails = [email.strip() for email in emails] split_info = el.split("Isotope ")[-1].strip().split(" is ")
version_info_dict["emails"] = cleaned_emails
elif line.startswith("DTlimit"): isotope_info = split_info[-1]
split = line.split(" : ") name = isotope_info.split(' ')[0].strip()
version_info_dict[split[0]] = ": ".join(split[1:])
elif line.startswith("Version"): # Get details
split = line.split("Version ") mass_g = float(isotope_info.split(",")[0].split('(')[1].split("=")[-1][:-2].strip())
version_number = split[1] mass_amu = float(isotope_info.split(",")[0].split('(')[-1].split("=")[-1].strip())
version_info_dict["version_number"] = version_number mass_mev = float(isotope_info.split(",")[-3].split("=")[-1].replace(")", "").strip())
elif line.startswith("git URL"): A = int(isotope_info.split(",")[-1].strip().split("=")[-1].replace(")", ""))
split = line.split("git URL ") Z = int(isotope_info.split(",")[-2].strip().split("=")[-1])
git_url = split[1]
version_info_dict["git_url"] = git_url #
elif line.startswith("Build: "): isotope_dict[int(split_info[0])] = {'name': name, 'Z': Z, 'A': A, 'mass_mev': mass_mev, 'mass_g': mass_g, 'mass_amu': mass_amu}
split = line.split("Build: ") version_info_dict['isotopes'] = isotope_dict
build = split[1]
version_info_dict["build"] = build ##########################
elif line.startswith("Compiled for "): # Argpairs:
split = line.split("Compiled for ") # Split off
compiled_for = split[1] argpairs = set([el for el in cleaned if el.startswith('ArgPair')])
version_info_dict["compiled_for"] = compiled_for cleaned = cleaned - argpairs
elif line.startswith("Stack limit "):
split = line.split("Stack limit ")
stack_limit = split[1]
version_info_dict["stack_limit"] = stack_limit
elif line.startswith("SVN URL "):
split = line.split("SVN URL ")
svn_url = split[1]
version_info_dict["svn_url"] = svn_url
elif line.startswith("git branch "):
split = line.split("git branch ")
git_branch = split[1]
version_info_dict["git_branch"] = git_branch
elif line.startswith("_SC_CLK_TCK"):
split = line.split(" = ")
_SC_CLK_TCK = split[1]
version_info_dict["_SC_CLK_TCK"] = _SC_CLK_TCK
elif line.startswith("Random number mean "):
split = line.split("Random number mean ")
random_number_mean = split[1]
version_info_dict["Random number mean"] = random_number_mean
elif line.startswith("SVN revision "):
split = line.split("SVN revision ")
svn_revision = split[1]
version_info_dict["svn_revision"] = svn_revision
elif line.startswith("Size of :"):
split = line.split("Size of :")
data_type_sizes = split[1]
version_info_dict["data_type_sizes"] = data_type_sizes
elif line.startswith("git revision "):
split = line.split("git revision ")
git_revision = split[1]
version_info_dict["git_revision"] = git_revision
elif line.startswith("BINARY_C_PRE_VERSION "):
split = line.split("BINARY_C_PRE_VERSION ")
binary_c_pre_version = split[1]
version_info_dict["binary_c_pre_version"] = binary_c_pre_version
elif line.startswith("Comenv accretion:"):
split = line.split("Comenv accretion:")
comenv_accretion = split[1]
version_info_dict["comenv_accretion"] = comenv_accretion
elif line.startswith("Compiled in parameters:"):
split = line.split("Compiled in parameters:")
compiled_in_parameters = split[1]
version_info_dict["compiled_in_parameters"] = compiled_in_parameters
elif line.startswith("__short__ is"):
split = line.split("__short__ is")
short_type = split[1]
version_info_dict["short_type"] = short_type
else:
print("Still found unmatched items!:\n{}".format(repr(line)))
argpair_dict = {}
for el in sorted(argpairs):
split_info = el.split("ArgPair ")[-1].split(" ")
if not argpair_dict.get(split_info[0], None):
argpair_dict[split_info[0]] = {split_info[1]: split_info[2]}
else:
argpair_dict[split_info[0]][split_info[1]] = split_info[2]
version_info_dict['argpairs'] = argpair_dict
##########################
# ensembles:
# Split off
ensembles = set([el for el in cleaned if el.startswith('Ensemble')])
cleaned = cleaned - ensembles
ensemble_dict = {}
for el in ensembles:
split_info = el.split("Ensemble ")[-1].split(" is ")
if len(split_info)>1:
ensemble_dict[int(split_info[0])] = split_info[-1]
version_info_dict['ensembles'] = ensemble_dict
##########################
# macros:
# Split off
macros = set([el for el in cleaned if el.startswith('macroxyz')])
cleaned = cleaned - macros
param_type_dict = {
'STRING': str,
'FLOAT': float,
'MACRO': str,
'INT': int,
'LONG_INT': int,
}
macros_dict = {}
for el in macros:
split_info = el.split("macroxyz ")[-1].split(" : ")
param_type = split_info[0]
new_split = "".join(split_info[1:]).split(" is ")
param_name = new_split[0]
param_value = " is ".join(new_split[1:])
# Sometimes the macros have extra information behind it. Needs an update in outputting by binary_c
try:
macros_dict[param_name] = param_type_dict[param_type](param_value)
except ValueError:
macros_dict[param_name] = str(param_value)
version_info_dict['macros'] = macros_dict
##########################
# Elements:
# Split off:
elements = set([el for el in cleaned if el.startswith('Element')])
cleaned = cleaned - elements
# Fill dict:
elements_dict = {}
for el in elements:
split_info = el.split("Element ")[-1].split(" : ")
name_info = split_info[0].split(" is ")
# get isotope info
isotopes = {}
if not split_info[-1][0]=='0':
isotope_string = split_info[-1].split(" = ")[-1]
isotopes = {int(split_isotope.split("=")[0]):split_isotope.split("=")[1] for split_isotope in isotope_string.split(" ")}
elements_dict[int(name_info[0])] = {'name': name_info[-1], 'atomic_number': int(name_info[0]), 'amt_isotopes': len(isotopes), 'isotopes': isotopes}
version_info_dict['elements'] = version_info_dict
##########################
# dt_limits:
# split off
dt_limits = set([el for el in cleaned if el.startswith('DTlimit')])
cleaned = cleaned - dt_limits
# Fill dict
dt_limits_dict = {}
for el in dt_limits:
split_info = el.split("DTlimit ")[-1].split(" : ")
dt_limits_dict[split_info[1].strip()] = {'index': int(split_info[0]), 'value': float(split_info[-1])}
version_info_dict['dt_limits'] = dt_limits_dict
##########################
# Nucleosynthesis sources:
# Split off
nucsyn_sources = set([el for el in cleaned if el.startswith('Nucleosynthesis')])
cleaned = cleaned - nucsyn_sources
# Fill dict
nucsyn_sources_dict = {}
for el in nucsyn_sources:
split_info = el.split("Nucleosynthesis source")[-1].strip().split(" is ")
nucsyn_sources_dict[int(split_info[0])] = split_info[-1]
version_info_dict['nucleosynthesis_sources'] = nucsyn_sources_dict
##########################
# miscellaneous:
# All those that I didnt catch with the above filters. Could try to get some more out though.
# TODO: filter a bit more.
misc_dict = {}
git_revision = [el for el in cleaned if el.startswith('git revision')]
misc_dict['git_revision'] = git_revision[0].split("git revision ")[-1].replace("\"", '')
git_branch = [el for el in cleaned if el.startswith('git branch')]
misc_dict['git_branch'] = git_branch[0].split("git branch ")[-1].replace("\"", '')
build = [el for el in cleaned if el.startswith('Build')]
misc_dict['build'] = build[0].split("Build: ")[-1].replace("\"", '')
email = [el for el in cleaned if el.startswith('Email')]
misc_dict['email'] = email[0].split("Email ")[-1].split(',')
misc_dict['uncaught'] = cleaned
version_info_dict['miscellaneous'] = misc_dict
return version_info_dict return version_info_dict
...@@ -727,7 +800,9 @@ def inspect_dict(dict_1, indent=0, print_structure=True): ...@@ -727,7 +800,9 @@ def inspect_dict(dict_1, indent=0, print_structure=True):
if print_structure: if print_structure:
print("\t" * indent, key, type(value)) print("\t" * indent, key, type(value))
if isinstance(value, dict): if isinstance(value, dict):
structure_dict[key] = inspect_dict(value, indent=indent + 1, print_structure=print_structure) structure_dict[key] = inspect_dict(
value, indent=indent + 1, print_structure=print_structure
)
return structure_dict return structure_dict
......
This diff is collapsed.
...@@ -17,7 +17,6 @@ grid_options_defaults_dict = { ...@@ -17,7 +17,6 @@ grid_options_defaults_dict = {
"main_pid": -1, # Placeholder for the main process id of the run. "main_pid": -1, # Placeholder for the main process id of the run.
# "output_dir": # "output_dir":
"commandline_input": "", "commandline_input": "",
########################## ##########################
# Execution log: # Execution log:
########################## ##########################
...@@ -73,7 +72,7 @@ grid_options_defaults_dict = { ...@@ -73,7 +72,7 @@ grid_options_defaults_dict = {
"grid", "grid",
"source_file", "source_file",
], # Available choices for type of population generation # TODO: fill later with monte carlo etc ], # Available choices for type of population generation # TODO: fill later with monte carlo etc
"source_file_filename": None, # filename for the source "source_file_filename": None, # filename for the source
"count": 0, # total count of systems "count": 0, # total count of systems
"probtot": 0, # total probability "probtot": 0, # total probability
"weight": 1.0, # weighting for the probability "weight": 1.0, # weighting for the probability
...@@ -121,46 +120,43 @@ grid_options_defaults_dict = { ...@@ -121,46 +120,43 @@ grid_options_defaults_dict = {
# Slurm stuff # Slurm stuff
######################################## ########################################
"slurm": 0, # dont use the slurm by default. 1 = use slurm "slurm": 0, # dont use the slurm by default. 1 = use slurm
"slurm_ntasks": 1, # CPUs required per array job: usually only need this "slurm_ntasks": 1, # CPUs required per array job: usually only need this
"slurm_command": "", # Command that slurm runs (e.g. evolve or join_datafiles) "slurm_command": "", # Command that slurm runs (e.g. evolve or join_datafiles)
"slurm_dir": "", # working directory containing scripts output logs etc. "slurm_dir": "", # working directory containing scripts output logs etc.
"slurm_njobs": 0, # number of scripts; set to 0 as default "slurm_njobs": 0, # number of scripts; set to 0 as default
"slurm_jobid": '', # slurm job id (%A) "slurm_jobid": "", # slurm job id (%A)
"slurm_memory": 512, # in MB, the memory use of the job "slurm_memory": 512, # in MB, the memory use of the job
"slurm_warn_max_memory": 1024, # in MB : warn if mem req. > this "slurm_warn_max_memory": 1024, # in MB : warn if mem req. > this
"slurm_use_all_node_CPUs": 0, # 1 = use all of a node's CPUs. 0 = use a given amount of CPUs "slurm_use_all_node_CPUs": 0, # 1 = use all of a node's CPUs. 0 = use a given amount of CPUs
"slurm_postpone_join": 0, # if 1 do not join on slurm, join elsewhere. want to do it off the slurm grid (e.g. with more RAM) "slurm_postpone_join": 0, # if 1 do not join on slurm, join elsewhere. want to do it off the slurm grid (e.g. with more RAM)
"slurm_jobarrayindex": '', # slurm job array index (%a) "slurm_jobarrayindex": "", # slurm job array index (%a)
"slurm_jobname": 'binary_grid', # default "slurm_jobname": "binary_grid", # default
"slurm_partition": None, "slurm_partition": None,
"slurm_time": 0, # total time. 0 = infinite time "slurm_time": 0, # total time. 0 = infinite time
"slurm_postpone_sbatch": 0, # if 1: don't submit, just make the script "slurm_postpone_sbatch": 0, # if 1: don't submit, just make the script
"slurm_array": None,# override for --array, useful for rerunning jobs "slurm_array": None, # override for --array, useful for rerunning jobs
"slurm_use_all_node_CPUs": 0, # if given nodes, set to 1 "slurm_use_all_node_CPUs": 0, # if given nodes, set to 1
# if given CPUs, set to 0 # if given CPUs, set to 0
# you will want to use this if your Slurm SelectType is e.g. linear # you will want to use this if your Slurm SelectType is e.g. linear
# which means it allocates all the CPUs in a node to the job # which means it allocates all the CPUs in a node to the job
"slurm_control_CPUs": 0, # if so, leave this many for Pythons control (0) "slurm_control_CPUs": 0, # if so, leave this many for Pythons control (0)
"slurm_array": None, # override for --array, useful for rerunning jobs "slurm_array": None, # override for --array, useful for rerunning jobs
"slurm_partition": None, # MUST be defined "slurm_partition": None, # MUST be defined
"slurm_extra_settings": {}, # Place to put extra configuration for the SLURM batch file. The key and value of the dict will become the key and value of the line in te slurm batch file. Will be put in after all the other settings (and before the command). Take care not to overwrite something without really meaning to do so. "slurm_extra_settings": {}, # Place to put extra configuration for the SLURM batch file. The key and value of the dict will become the key and value of the line in te slurm batch file. Will be put in after all the other settings (and before the command). Take care not to overwrite something without really meaning to do so.
######################################## ########################################
# Condor stuff # Condor stuff
######################################## ########################################
"condor": 0, # 1 to use condor, 0 otherwise "condor": 0, # 1 to use condor, 0 otherwise
"condor_command": '', # condor command e.g. "evolve", "join" "condor_command": "", # condor command e.g. "evolve", "join"
"condor_dir": '', # working directory containing e.g. scripts, output, logs (e.g. should be NFS available to all) "condor_dir": "", # working directory containing e.g. scripts, output, logs (e.g. should be NFS available to all)
"condor_njobs": '', # number of scripts/jobs that CONDOR will run in total "condor_njobs": "", # number of scripts/jobs that CONDOR will run in total
"condor_jobid": '', # condor job id "condor_jobid": "", # condor job id
"condor_postpone_join": 0, # if 1, data is not joined, e.g. if you want to do it off the condor grid (e.g. with more RAM) "condor_postpone_join": 0, # if 1, data is not joined, e.g. if you want to do it off the condor grid (e.g. with more RAM)
# "condor_join_machine": None, # if defined then this is the machine on which the join command should be launched (must be sshable and not postponed) # "condor_join_machine": None, # if defined then this is the machine on which the join command should be launched (must be sshable and not postponed)
"condor_join_pwd": '', # directory the join should be in (defaults to $ENV{PWD} if undef) "condor_join_pwd": "", # directory the join should be in (defaults to $ENV{PWD} if undef)
"condor_memory": 1024, # in MB, the memory use (ImageSize) of the job "condor_memory": 1024, # in MB, the memory use (ImageSize) of the job
"condor_universe": 'vanilla', # usually vanilla universe "condor_universe": "vanilla", # usually vanilla universe
"condor_extra_settings": {}, # Place to put extra configuration for the CONDOR submit file. The key and value of the dict will become the key and value of the line in te slurm batch file. Will be put in after all the other settings (and before the command). Take care not to overwrite something without really meaning to do so. "condor_extra_settings": {}, # Place to put extra configuration for the CONDOR submit file. The key and value of the dict will become the key and value of the line in te slurm batch file. Will be put in after all the other settings (and before the command). Take care not to overwrite something without really meaning to do so.
# snapshots and checkpoints # snapshots and checkpoints
# condor_snapshot_on_kill=>0, # if 1 snapshot on SIGKILL before exit # condor_snapshot_on_kill=>0, # if 1 snapshot on SIGKILL before exit
# condor_load_from_snapshot=>0, # if 1 check for snapshot .sv file and load it if found # condor_load_from_snapshot=>0, # if 1 check for snapshot .sv file and load it if found
...@@ -180,7 +176,6 @@ grid_options_defaults_dict = { ...@@ -180,7 +176,6 @@ grid_options_defaults_dict = {
# condor_resubmit_submitted=>0, # condor_resubmit_submitted=>0,
# condor_resubmit_running=>0, # condor_resubmit_running=>0,
# condor_resubmit_crashed=>0, # condor_resubmit_crashed=>0,
########################## ##########################
# Unordered. Need to go through this. Copied from the perl implementation. # Unordered. Need to go through this. Copied from the perl implementation.
########################## ##########################
......
...@@ -12,6 +12,7 @@ import time ...@@ -12,6 +12,7 @@ import time
import subprocess import subprocess
import __main__ as main import __main__ as main
def get_slurm_version(): def get_slurm_version():
""" """
Function that checks whether slurm is installed and returns the version if its installed. Function that checks whether slurm is installed and returns the version if its installed.
...@@ -23,7 +24,7 @@ def get_slurm_version(): ...@@ -23,7 +24,7 @@ def get_slurm_version():
try: try:
slurm_version = ( slurm_version = (
subprocess.run(['sinfo', "-V"], stdout=subprocess.PIPE, check=True) subprocess.run(["sinfo", "-V"], stdout=subprocess.PIPE, check=True)
.stdout.decode("utf-8") .stdout.decode("utf-8")
.split() .split()
)[1] )[1]
...@@ -38,6 +39,7 @@ def get_slurm_version(): ...@@ -38,6 +39,7 @@ def get_slurm_version():
return slurm_version return slurm_version
def get_condor_version(): def get_condor_version():
""" """
Function that checks whether slurm is installed and returns the version if its installed. Function that checks whether slurm is installed and returns the version if its installed.
...@@ -51,7 +53,9 @@ def get_condor_version(): ...@@ -51,7 +53,9 @@ def get_condor_version():
try: try:
condor_version = ( condor_version = (
subprocess.run(['condor_q', "--version"], stdout=subprocess.PIPE, check=True) subprocess.run(
["condor_q", "--version"], stdout=subprocess.PIPE, check=True
)
.stdout.decode("utf-8") .stdout.decode("utf-8")
.split() .split()
)[1] )[1]
...@@ -66,6 +70,7 @@ def get_condor_version(): ...@@ -66,6 +70,7 @@ def get_condor_version():
return condor_version return condor_version
def create_directories_hpc(working_dir): def create_directories_hpc(working_dir):
""" """
Function to create a set of directories, given a root directory Function to create a set of directories, given a root directory
...@@ -78,7 +83,15 @@ def create_directories_hpc(working_dir): ...@@ -78,7 +83,15 @@ def create_directories_hpc(working_dir):
print("Error. Working directory {} does not exist! Aborting") print("Error. Working directory {} does not exist! Aborting")
raise ValueError raise ValueError
directories_list = ['scripts', 'stdout', 'stderr', 'results', 'logs', 'status', 'joining'] directories_list = [
"scripts",
"stdout",
"stderr",
"results",
"logs",
"status",
"joining",
]
# Make directories. # Make directories.
for subdir in directories_list: for subdir in directories_list:
...@@ -100,6 +113,7 @@ def create_directories_hpc(working_dir): ...@@ -100,6 +113,7 @@ def create_directories_hpc(working_dir):
directories_exist = False directories_exist = False
print("..Finished! Directories exist.") print("..Finished! Directories exist.")
def path_of_calling_script(): def path_of_calling_script():
""" """
Function to get the name of the script the user executes. Function to get the name of the script the user executes.
...@@ -107,6 +121,7 @@ def path_of_calling_script(): ...@@ -107,6 +121,7 @@ def path_of_calling_script():
return main.__file__ return main.__file__
def get_python_details(): def get_python_details():
""" """
Function to get some info about the used python version and virtualenv etc Function to get some info about the used python version and virtualenv etc
...@@ -115,8 +130,8 @@ def get_python_details(): ...@@ -115,8 +130,8 @@ def get_python_details():
python_info_dict = {} python_info_dict = {}
# #
python_info_dict['virtualenv'] = os.getenv('VIRTUAL_ENV') python_info_dict["virtualenv"] = os.getenv("VIRTUAL_ENV")
python_info_dict['executable'] = sys.executable python_info_dict["executable"] = sys.executable
python_info_dict['version'] = sys.version python_info_dict["version"] = sys.version
return python_info_dict return python_info_dict
File: "binary_c-python/__init__.py"
- File is empty
Needed: 0; Found: 0; Missing: 0; Coverage: 0.0%
File: "binary_c-python/setup.py"
- No module docstring
- No docstring for `readme`
Needed: 2; Found: 0; Missing: 2; Coverage: 0.0%
File: "binary_c-python/examples/example_population.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/examples/examples.py"
- No module docstring
Needed: 6; Found: 5; Missing: 1; Coverage: 83.3%
File: "binary_c-python/examples/example_plotting_distributions.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/examples/examples_custom_logging.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/examples/.ipynb_checkpoints/examples-checkpoint.py"
- No module docstring
Needed: 5; Found: 4; Missing: 1; Coverage: 80.0%
File: "binary_c-python/snippets/multiprocessing_comparison.py"
- No module docstring
- No docstring for `parse_function`
- No docstring for `evolve_mp`
- No docstring for `g`
Needed: 5; Found: 1; Missing: 4; Coverage: 20.0%
File: "binary_c-python/snippets/verbose.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/snippets/test.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/snippets/increment.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/snippets/phasevol.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/snippets/dict_merging.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/snippets/yield_test.py"
- No module docstring
- No docstring for `yielder`
Needed: 2; Found: 0; Missing: 2; Coverage: 0.0%
File: "binary_c-python/snippets/montecarlo_example.py"
- No module docstring
- No docstring for `mass_montecarlo`
- No docstring for `calc_alpha`
- No docstring for `period_montecarlo`
- No docstring for `calc_beta`
- No docstring for `massratio_montecarlo`
- No docstring for `eccentricity_montecarlo`
Needed: 7; Found: 0; Missing: 7; Coverage: 0.0%
File: "binary_c-python/snippets/defaultdict.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/snippets/multiprocessing_test.py"
- No module docstring
- No docstring for `calculate`
- No docstring for `calculate.run`
- No docstring for `run.f`
Needed: 4; Found: 0; Missing: 4; Coverage: 0.0%
File: "binary_c-python/docs/source/conf.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/lib/__init__.py"
- File is empty
Needed: 0; Found: 0; Missing: 0; Coverage: 0.0%
File: "binary_c-python/binarycpython/__init__.py"
- File is empty
Needed: 0; Found: 0; Missing: 0; Coverage: 0.0%
File: "binary_c-python/binarycpython/core/__init__.py"
- File is empty
Needed: 0; Found: 0; Missing: 0; Coverage: 0.0%
File: "binary_c-python/binarycpython/utils/grid_options_defaults.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/binarycpython/utils/distribution_functions.py"
- No module docstring
- No docstring for `calculate_constants_three_part_powerlaw`
- No docstring for `Arenou2010_binary_fraction`
Needed: 23; Found: 20; Missing: 3; Coverage: 87.0%
File: "binary_c-python/binarycpython/utils/stellar_types.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/binarycpython/utils/spacing_functions.py"
- No module docstring
- No docstring for `const`
Needed: 2; Found: 0; Missing: 2; Coverage: 0.0%
File: "binary_c-python/binarycpython/utils/useful_funcs.py"
- No module docstring
Needed: 7; Found: 6; Missing: 1; Coverage: 85.7%
File: "binary_c-python/binarycpython/utils/__init__.py"
- File is empty
Needed: 0; Found: 0; Missing: 0; Coverage: 0.0%
File: "binary_c-python/binarycpython/utils/custom_logging_functions.py"
- No module docstring
Needed: 9; Found: 8; Missing: 1; Coverage: 88.9%
File: "binary_c-python/binarycpython/utils/functions.py"
- No module docstring
- No docstring for `parse_binary_c_version_info`
Needed: 13; Found: 11; Missing: 2; Coverage: 84.6%
File: "binary_c-python/binarycpython/utils/grid.py"
- No module docstring
- No docstring for `Population`
- No docstring for `Population.set_bse_option`
- No docstring for `evolve_population_comparison.evolve_mp`
- No docstring for `evolve_population_comparison.g`
- No docstring for `evolve_population_mp.evolve_mp`
- No docstring for `evolve_population_mp.g`
Needed: 32; Found: 25; Missing: 7; Coverage: 78.1%
File: "binary_c-python/binarycpython/utils/.ipynb_checkpoints/custom_logging_functions-checkpoint.py"
- No module docstring
Needed: 9; Found: 8; Missing: 1; Coverage: 88.9%
File: "binary_c-python/binarycpython/utils/.ipynb_checkpoints/functions-checkpoint.py"
- No module docstring
- No docstring for `load_logfile`
Needed: 8; Found: 6; Missing: 2; Coverage: 75.0%
File: "binary_c-python/tests/python_API_test.py"
- No module docstring
- No docstring for `test_run_binary`
- No docstring for `test_return_help`
- No docstring for `test_return_arglines`
- No docstring for `test_run_binary_with_log`
- No docstring for `test_run_binary_with_custom_logging`
- No docstring for `test_return_help_all`
- No docstring for `test_return_version_info`
- No docstring for `test_return_store`
- No docstring for `test_run_system`
Needed: 10; Found: 0; Missing: 10; Coverage: 0.0%
File: "binary_c-python/tests/random_tests.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/tests/function_tests.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/tests/population/plot_scaling.py"
- No module docstring
- No docstring for `calc_mean_and_std`
Needed: 2; Found: 0; Missing: 2; Coverage: 0.0%
File: "binary_c-python/tests/population/grid_tests_cmdline.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/tests/population/multiprocessing_via_population_comparison.py"
- No module docstring
- No docstring for `parse_function`
Needed: 3; Found: 1; Missing: 2; Coverage: 33.3%
File: "binary_c-python/tests/population/grid_tests.py"
- No module docstring
Needed: 1; Found: 0; Missing: 1; Coverage: 0.0%
File: "binary_c-python/tests/population/global_variable_for_distributions.py"
- No module docstring
- No docstring for `with_glob`
- No docstring for `without_glob`
Needed: 6; Found: 3; Missing: 3; Coverage: 50.0%
File: "binary_c-python/.ipynb_checkpoints/python_API_test-checkpoint.py"
- No module docstring
- No docstring for `run_test_binary`
Needed: 2; Found: 0; Missing: 2; Coverage: 0.0%
Overall statistics for 41 files (5 files are empty):
Docstrings needed: 173; Docstrings found: 98; Docstrings missing: 75
Total docstring coverage: 56.6%; Grade: Not bad
...@@ -68,6 +68,7 @@ def test_return_persistent_data_memaddr(): ...@@ -68,6 +68,7 @@ def test_return_persistent_data_memaddr():
assert isinstance(output, int), "memory adress has to be an integer" assert isinstance(output, int), "memory adress has to be an integer"
assert output != 0, "memory adress seems not to have a correct value" assert output != 0, "memory adress seems not to have a correct value"
def test_passing_persistent_data_to_run_system(): def test_passing_persistent_data_to_run_system():
# Function to test the passing of the persistent data memoery adress, and having ensemble_defer = True # Function to test the passing of the persistent data memoery adress, and having ensemble_defer = True
# We should see that the results of multiple systems have been added to the one output json # We should see that the results of multiple systems have been added to the one output json
...@@ -292,8 +293,6 @@ def test_adding_ensemble_output(): ...@@ -292,8 +293,6 @@ def test_adding_ensemble_output():
# print(json.dumps(test_1_merged_dict, indent=4)) # print(json.dumps(test_1_merged_dict, indent=4))
# print(json.dumps(test_2_json, indent=4)) # print(json.dumps(test_2_json, indent=4))
# #
assert inspect_dict(test_1_merged_dict, print_structure=False) == inspect_dict( assert inspect_dict(test_1_merged_dict, print_structure=False) == inspect_dict(
test_2_json, print_structure=False test_2_json, print_structure=False
...@@ -359,6 +358,7 @@ def test_free_and_json_output(): ...@@ -359,6 +358,7 @@ def test_free_and_json_output():
# ensemble_jsons_1 = [line for line in output_1.splitlines() if line.startswith("ENSEMBLE_JSON")] # ensemble_jsons_1 = [line for line in output_1.splitlines() if line.startswith("ENSEMBLE_JSON")]
# json_1 = json.loads(ensemble_jsons_1[0][len("ENSEMBLE_JSON "):], cls=binarycDecoder) # json_1 = json.loads(ensemble_jsons_1[0][len("ENSEMBLE_JSON "):], cls=binarycDecoder)
def test_all(): def test_all():
test_return_persistent_data_memaddr() test_return_persistent_data_memaddr()
test_passing_persistent_data_to_run_system() test_passing_persistent_data_to_run_system()
...@@ -367,6 +367,7 @@ def test_all(): ...@@ -367,6 +367,7 @@ def test_all():
test_free_and_json_output() test_free_and_json_output()
test_combine_with_empty_json() test_combine_with_empty_json()
#### ####
if __name__ == "__main__": if __name__ == "__main__":
# test_return_persistent_data_memaddr() # test_return_persistent_data_memaddr()
......
...@@ -9,6 +9,7 @@ def test_return_store_memaddr(): ...@@ -9,6 +9,7 @@ def test_return_store_memaddr():
print("store memory adress:") print("store memory adress:")
print(textwrap.indent(str(output), "\t")) print(textwrap.indent(str(output), "\t"))
def test_unload_store_memaddr(): def test_unload_store_memaddr():
output = binary_c_python_api.return_store_memaddr() output = binary_c_python_api.return_store_memaddr()
...@@ -19,6 +20,7 @@ def test_unload_store_memaddr(): ...@@ -19,6 +20,7 @@ def test_unload_store_memaddr():
_ = binary_c_python_api.free_store_memaddr(output) _ = binary_c_python_api.free_store_memaddr(output)
print("freed store memaddr") print("freed store memaddr")
#### ####
if __name__ == "__main__": if __name__ == "__main__":
test_return_store_memaddr() test_return_store_memaddr()
......
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