mbank.parser

Gathers group of options useful for the many executables that make mbank handy

add_flow_options(parser)[source]

Adds to the parser a set of arguments relevant to the training of a normalizing flow

Parameters:

parser (argparse.ArgumentParser) – The parser object to be updated

add_general_options(parser)[source]

Adds to the parser some general options

Parameters:

parser (argparse.ArgumentParser) – The parser object to be updated

add_injections_options(parser)[source]

Adds to the parser a set of arguments relevant to injection recovery

Parameters:

parser (argparse.ArgumentParser) – The parser object to be updated

add_metric_options(parser)[source]

Adds to the parser a set of arguments defining the metric

Parameters:

parser (argparse.ArgumentParser) – The parser object to be updated

add_range_options(parser)[source]

Adds to the parser a set of arguments describing ranges on the physical quantities of a BBH

Parameters:

parser (argparse.ArgumentParser) – The parser object to be updated

add_template_placement_options(parser)[source]

Adds to the parser a set of arguments relevant to template placing

Parameters:

parser (argparse.ArgumentParser) – The parser object to be updated

add_tiling_generation_options(parser)[source]

Adds to the parser a set of arguments relevant to the generation of a tiling

Parameters:

parser (argparse.ArgumentParser) – The parser object to be updated

class boundary_keeper(args)[source]

Class to keep a set of boundaries on the masses defined by the argument parsers. The object is callable to check whether a given point, with a given variable format is inside the mass boundaries. An extra boundary box can be specified at each call to enforce other type of boundaries

sample(n_samples, variable_format)[source]

Samples from the uniform distribution in the coordinates

get_boundary_box_from_args(args)[source]

Given the arguments stored in a parser, it returns a rectangular boundary box for the parameter space defined by the arguments

Parameters:

args (argparse.Namespace) – Arguments encoded in a parser Namespace object

make_sub_file(run_dir, run_name, memory_requirement=4, disk_requirement=4, cpu_requirement=1)[source]

Creates an condor submit file to run any mbank executable. The commmand to run and its arguments are taken from the command line arguments

Parameters:
  • run_dir (str) – The run directory where the submit file is executed

  • run_name (str) – A name for the run, to identify the executable

  • memory_requirement (int) – Memory requirements in GB for the condor job

  • disk_requirement (int) – Disk requirements in GB for the condor job

  • cpu_requirement (int) – Number of CPUs requested for the condor job

save_args(args, filename)[source]

Given a set of arguments, it stores them in json format to a file filename

Parameters:
  • args (argparse.Namespace) – Arguments encoded in a parser Namespace object

  • filename (str) – Name of the file to save the arguments to

updates_args_from_ini(ini_file, args, parser)[source]

Updates the arguments of Namespace args according to the given ini_file.

Parameters:
Returns:

args – Updated parser namespace object

Return type:

argparse.Namespace