covid-sim
Loading...
Searching...
No Matches
run_sample Namespace Reference

Functions

 try_remove (f)
 parse_args ()

Variables

 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"]
 exe = args.covidsim
 build_dir = os.path.join(args.outputdir, "build")
 ignore_errors
 exist_ok
 cwd = os.getcwd()
 check
 outputdir
 admin_file
str 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()

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.

◆ try_remove()

run_sample.try_remove ( f)

Definition at line 15 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.

◆ args

run_sample.args = parse_args()

Definition at line 80 of file run_sample.py.

◆ build_dir

run_sample.build_dir = os.path.join(args.outputdir, "build")

Definition at line 92 of file run_sample.py.

◆ canada

list run_sample.canada = [ "Canada" ]

Definition at line 84 of file run_sample.py.

◆ cf

run_sample.cf = os.path.join(args.paramdir, "p_{0}.txt".format(root))

Definition at line 187 of file run_sample.py.

◆ check

run_sample.check

Definition at line 101 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.

◆ control_roots

list run_sample.control_roots = [ "PC7_CI_HQ_SD" ]

Definition at line 185 of file run_sample.py.

◆ cwd

run_sample.cwd = os.getcwd()

Definition at line 97 of file run_sample.py.

◆ exe

run_sample.exe = args.covidsim

Definition at line 90 of file run_sample.py.

◆ exist_ok

run_sample.exist_ok

Definition at line 96 of file run_sample.py.

◆ ignore_errors

run_sample.ignore_errors

Definition at line 95 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.

◆ nigeria

list run_sample.nigeria = ["Nigeria"]

Definition at line 86 of file run_sample.py.

◆ no_int_file

run_sample.no_int_file = os.path.join(args.paramdir, "p_NoInt.txt")

Definition at line 175 of file run_sample.py.

◆ outputdir

run_sample.outputdir

Definition at line 113 of file run_sample.py.

◆ pp_file

run_sample.pp_file = os.path.join(args.paramdir, "preUS_R0=2.0.txt")

Definition at line 162 of file run_sample.py.

◆ process

run_sample.process = subprocess.run(cmd, check=True)

Definition at line 240 of file run_sample.py.

◆ r

float run_sample.r = 3.0

Definition at line 205 of file run_sample.py.

◆ rs

float run_sample.rs = r/2

Definition at line 206 of file run_sample.py.

◆ school_file

run_sample.school_file = None

Definition at line 194 of file run_sample.py.

◆ united_states

list run_sample.united_states = [ "United_States" ]

Definition at line 83 of file run_sample.py.

◆ usa_territories

list run_sample.usa_territories = ["Alaska", "Hawaii", "Guam", "Virgin_Islands_US", "Puerto_Rico", "American_Samoa"]

Definition at line 85 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.

◆ wpop_file_root

str run_sample.wpop_file_root = "usacan"

Definition at line 128 of file run_sample.py.