-
Notifications
You must be signed in to change notification settings - Fork 96
/
table_dict.py
51 lines (33 loc) · 1.27 KB
/
table_dict.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
# ActivitySim
# See full license in LICENSE.txt.
from __future__ import (absolute_import, division, print_function, )
from future.standard_library import install_aliases
install_aliases() # noqa: E402
import logging
from collections import OrderedDict
from activitysim.core import inject
logger = logging.getLogger(__name__)
"""
When the pipeline is restarted and tables are loaded, we need to know which ones
should be registered as random number generator channels.
"""
RANDOM_CHANNELS = ['households', 'persons', 'tours', 'joint_tour_participants', 'trips']
TRACEABLE_TABLES = ['households', 'persons', 'tours', 'joint_tour_participants', 'trips']
@inject.injectable()
def rng_channels():
# bug
return RANDOM_CHANNELS
@inject.injectable()
def traceable_tables():
# names of all traceable tables ordered by dependency on household_id
# e.g. 'persons' has to be registered AFTER 'households'
return TRACEABLE_TABLES
@inject.injectable()
def traceable_table_indexes():
# traceable_table_indexes is OrderedDict {<index_name>: <table_name>}
# so we can find first registered table to slice by ref_col
return OrderedDict()
@inject.injectable()
def traceable_table_ids():
# traceable_table_ids is dict {<table_name>: [<id>, <id>]}
return dict()