Skip to content

Commit

Permalink
experimental reorg splitting up large file into several smaller files
Browse files Browse the repository at this point in the history
  • Loading branch information
fscottfoti committed Mar 4, 2015
1 parent 522f35d commit d83e62e
Show file tree
Hide file tree
Showing 16 changed files with 1,102 additions and 1,196 deletions.
3 changes: 0 additions & 3 deletions activitysim/defaults/__init__.py

This file was deleted.

87 changes: 0 additions & 87 deletions activitysim/defaults/datasources.py

This file was deleted.

91 changes: 0 additions & 91 deletions activitysim/defaults/variables.py

This file was deleted.

44 changes: 44 additions & 0 deletions example/activitysim.py
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")
Loading

0 comments on commit d83e62e

Please sign in to comment.