covid-sim
Functions | Variables
run_sample Namespace Reference

Functions

def try_remove (f)
 
def parse_args ()
 

Variables

def args = parse_args()
 
list united_states = [ "United_States" ]
 
list canada = [ "Canada" ]
 
list usa_territories = ["Alaska", "Hawaii", "Guam", "Virgin_Islands_US", "Puerto_Rico", "American_Samoa"]
 
list nigeria = ["Nigeria"]
 
def exe = args.covidsim
 
 build_dir = os.path.join(args.outputdir, "build")
 
 ignore_errors
 
 exist_ok
 
 cwd = os.getcwd()
 
 check
 
 outputdir
 
 admin_file
 
string wpop_file_root = "usacan"
 
 wpop_file_gz
 
 wpop_file
 
 wpop_bin
 
 pp_file = os.path.join(args.paramdir, "preUS_R0=2.0.txt")
 
 no_int_file = os.path.join(args.paramdir, "p_NoInt.txt")
 
list control_roots = [ "PC7_CI_HQ_SD" ]
 
 cf = os.path.join(args.paramdir, "p_{0}.txt".format(root))
 
 school_file = None
 
float r = 3.0
 
float rs = r/2
 
 network_bin
 
list cmd
 
 process = subprocess.run(cmd, check=True)
 

Detailed Description

Run the sample data.

See README.md in this directory for more information.

Function Documentation

◆ parse_args()

def run_sample.parse_args ( )
Parse the arguments.

On exit: Returns the result of calling argparse.parse()

args.covidsim is the name of the CovidSim executable
args.datadir is the directory with the input data
args.paramdir is the directory with the parameters in it
args.outputdir is the directory where output will be stored
args.threads is the number of threads to use

Definition at line 21 of file run_sample.py.

Variable Documentation

◆ admin_file

run_sample.admin_file
Initial value:
1 = os.path.join(args.datadir, "admin_units",
2  "{0}_admin.txt".format(args.country))

Definition at line 116 of file run_sample.py.

◆ cmd

list run_sample.cmd
Initial value:
1 = [
2  exe,
3  "/c:{0}".format(args.threads),
4  "/A:" + admin_file
5 ]

Definition at line 218 of file run_sample.py.

◆ network_bin

run_sample.network_bin
Initial value:
1 = os.path.join(
2  args.outputdir,
3  "Network_{0}_T{1}_R{2}.bin".format(args.country, args.threads, r))

Definition at line 210 of file run_sample.py.

◆ wpop_bin

run_sample.wpop_bin
Initial value:
1 = os.path.join(
2  args.outputdir,
3  "{0}_pop_density.bin".format(args.country))

Definition at line 149 of file run_sample.py.

◆ wpop_file

run_sample.wpop_file
Initial value:
1 = os.path.join(
2  args.outputdir,
3  "wpop_{0}.txt".format(wpop_file_root))

Definition at line 146 of file run_sample.py.

◆ wpop_file_gz

run_sample.wpop_file_gz
Initial value:
1 = os.path.join(
2  args.datadir,
3  "populations",
4  "wpop_{0}.txt.gz".format(wpop_file_root))

Definition at line 136 of file run_sample.py.