-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.py
52 lines (36 loc) · 2.29 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import sys
import os
import pandas as pd
import json
paths = os.getcwd() + "/"
sys.path.insert(0, paths + "/src")
from calculator import calculator
def main(targets):
if (("test" in targets) or (targets == "test")):
t0 = json.load(open('config/room101.json'))
print("In " + t0["rm"] + " given " + str(t0["n_occupants"]) + " occupants " + t0["activity"] + " and " + t0["expiratory_activity"]
+ " for " + str(t0["time"]) + " hours: ")
calculator.infection_risk(t0["time"], t0["rm"], t0["n_occupants"], t0["activity"], t0["expiratory_activity"], paths + "/data/raw/rm.csv")
print()
t0 = json.load(open('config/rm2.json'))
print("In " + t0["rm"] + " given " + str(t0["n_occupants"]) + " occupants " + t0["activity"] + " and " + t0["expiratory_activity"]
+ " for " + str(t0["time"]) + " hours: ")
calculator.infection_risk(t0["time"], t0["rm"], t0["n_occupants"], t0["activity"], t0["expiratory_activity"], paths + "/data/raw/rm.csv")
print()
t0 = json.load(open('config/rm3.json'))
print("In " + t0["rm"] + " given " + str(t0["n_occupants"]) + " occupants " + t0["activity"] + " and " + t0["expiratory_activity"]
+ " for " + str(t0["time"]) + " hours: ")
calculator.infection_risk(t0["time"], t0["rm"], t0["n_occupants"], t0["activity"], t0["expiratory_activity"], paths + "/data/raw/rm.csv")
print()
t0 = json.load(open('config/rm4.json'))
print("In " + t0["rm"] + " given " + str(t0["n_occupants"]) + " occupants " + t0["activity"] + " and " + t0["expiratory_activity"]
+ " for " + str(t0["time"]) + " hours: ")
calculator.infection_risk(t0["time"], t0["rm"], t0["n_occupants"], t0["activity"], t0["expiratory_activity"], paths + "/data/raw/rm.csv")
print()
t0 = json.load(open('config/rm5.json'))
print("In " + t0["rm"] + " given " + str(t0["n_occupants"]) + " occupants " + t0["activity"] + " and " + t0["expiratory_activity"]
+ " for " + str(t0["time"]) + " hours: ")
calculator.infection_risk(t0["time"], t0["rm"], t0["n_occupants"], t0["activity"], t0["expiratory_activity"], paths + "/data/raw/rm.csv")
if __name__ == '__main__':
targets = sys.argv[1:]
main(targets)