-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
experimental reorg splitting up large file into several smaller files
- Loading branch information
1 parent
522f35d
commit d83e62e
Showing
16 changed files
with
1,102 additions
and
1,196 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import urbansim.sim.simulation as sim | ||
import urbansim.utils.misc as usim_misc | ||
import os | ||
from activitysim import activitysim as asim | ||
import openmatrix as omx | ||
from activitysim import skim | ||
import numpy as np | ||
import pandas as pd | ||
|
||
|
||
""" | ||
Definition of terms: | ||
CDAP = coordinated daily activity pattern | ||
TDD = tour departure and duration | ||
""" | ||
|
||
|
||
warnings.filterwarnings('ignore', category=pd.io.pytables.PerformanceWarning) | ||
pd.options.mode.chained_assignment = None | ||
|
||
|
||
@sim.injectable(cache=True) | ||
def settings(): | ||
with open(os.path.join(misc.configs_dir(), "settings.yaml")) as f: | ||
settings = yaml.load(f) | ||
# monkey patch on the settings object since it's pretty global | ||
# but will also be available as injectable | ||
sim.settings = settings | ||
return settings | ||
|
||
|
||
@sim.injectable(cache=True) | ||
def store(settings): | ||
return pd.HDFStore( | ||
os.path.join(misc.data_dir(), settings["store"]), | ||
mode='r') | ||
|
||
|
||
# these are the alternatives for the workplace choice | ||
@sim.table() | ||
def zones(): | ||
# I grant this is a weird idiom but it helps to name the index | ||
return pd.DataFrame({"TAZ": np.arange(1454)+1}).set_index("TAZ") |
Oops, something went wrong.