-
Notifications
You must be signed in to change notification settings - Fork 28
/
assumptions.py
94 lines (80 loc) · 2.14 KB
/
assumptions.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import os
import orca
import pandas as pd
from urbansim.utils import misc
orca.add_injectable("building_sqft_per_job", {
-1: 400,
1: 400,
2: 400,
3: 400,
4: 355,
5: 1161,
6: 470,
7: 661,
8: 960,
9: 825,
10: 445,
11: 445,
12: 383,
13: 383,
14: 383,
})
# this maps building type ids to general building types
# basically just reduces dimensionality
orca.add_injectable("building_type_map", {
1: "Residential",
2: "Residential",
3: "Residential",
4: "Office",
5: "Hotel",
6: "School",
7: "Industrial",
8: "Industrial",
9: "Industrial",
10: "Retail",
11: "Retail",
12: "Residential",
13: "Retail",
14: "Office"
})
# this maps building "forms" from the developer model
# to building types so that when the developer builds a
# "form" this can be converted for storing as a type
# in the building table - in the long run, the developer
# forms and the building types should be the same and the
# developer model should account for the differences
orca.add_injectable("form_to_btype", {
'residential': [1, 2, 3],
'industrial': [7, 8, 9],
'retail': [10, 11],
'office': [4],
'mixedresidential': [12],
'mixedoffice': [14],
})
orca.add_injectable("store", pd.HDFStore(os.path.join(misc.data_dir(),
"sanfran_public.h5"),
mode="r"))
orca.add_injectable("fillna_config", {
"buildings": {
"residential_sales_price": ("zero", "int"),
"non_residential_rent": ("zero", "int"),
"residential_units": ("zero", "int"),
"non_residential_sqft": ("zero", "int"),
"year_built": ("median", "int"),
"building_type_id": ("mode", "int")
},
"jobs": {
"job_category": ("mode", "str"),
}
})
# this keeps track of all of the inputs that get "switched"
# whenever a scenario is changed
orca.add_injectable("scenario_inputs", {
"baseline": {
"zoning_table_name": "zoning_baseline"
},
"test": {
"zoning_table_name": "zoning_test"
}
})
orca.add_injectable("scenario", "baseline")