-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
52 lines (44 loc) · 1.43 KB
/
main.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
"""REB main file"""
import time
from milap.constants import (
ANCILLARY_ASSUMPTIONS_FILE,
EXIT_LIMIT_ASSUMPTIONS_FILE,
MIDT_FLOW_FOLDER,
MIDT_LOADFACTOR_FOLDER,
OAG_TOFROM_FOLDER,
SEA_CITY_PAIRS,
TAX_ASSUMPTIONS_FILE,
)
from milap.csvloader import (
AssumptionsLoader,
FlowFolderLoader,
LoadFactorFolderLoader,
ToFromFolderLoader,
)
from milap.revenue import RebDataContainer, RebCalculator, RebPlotter
def template():
"""General template for development"""
st = time.time()
flow = FlowFolderLoader(MIDT_FLOW_FOLDER)
flow.merge_city_pairs(
SEA_CITY_PAIRS
) # I dont like this because I don't want to automatically add city pairs when importing Flow.
reb_data = RebDataContainer(
flow,
LoadFactorFolderLoader(MIDT_LOADFACTOR_FOLDER),
ToFromFolderLoader(OAG_TOFROM_FOLDER),
AssumptionsLoader(TAX_ASSUMPTIONS_FILE),
AssumptionsLoader(ANCILLARY_ASSUMPTIONS_FILE),
AssumptionsLoader(EXIT_LIMIT_ASSUMPTIONS_FILE),
)
reb_data.paper2_preprocess()
sea_reb_calculator = RebCalculator(reb_data)
df, gy, re, reb = sea_reb_calculator.calculate_reb()
reb_plotter = RebPlotter(df, gy, re, reb, reb_data)
reb_plotter.plot_city_pairs()
en = time.time()
print(f"Time taken: {en - st}")
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if __name__ == "__main__":
template()
print()