Skip to content

Guide to existing models

Paul Sohn edited this page Feb 6, 2017 · 10 revisions

Background Reading

Code exploration

The easiest way to run a full parcel urbansim model is to clone the sanfran_urbansim repository, since it includes all of the data in the repo. This is a simplified, working-out-of-the-box implementation of an Urbansim parcel model. It may be a little outdated at this point, but is an easy way to get up and running.

Workflow

  • To get use out of an urbansim model, you would typically want to estimate coefficients using the steps in Estimation.ipynb, then run a simulation using those settings, using steps in Simulation.ipynb.
  • The Orca steps in the simulation notebook that you want to pay attention to are "feasibility", "residential_developer", and "nonresidential_developer".
  • These steps are defined in models.py, which calls functions in utils.py.
  • The run_feasibility function is the interface to the core SqftProForma code, and returns a dataframe that is fed into run_developer, which is similarly the interface to the Developer model.

Exploring the code

I recommend following the full workflow above step-by-step in one of two ways:

  • Create a new jupyter notebook, run all of the steps from Simulation.ipynb until feasibility, then copy code from the core SqftProForma and Developer models. I can send my notebooks for this.
  • Copy the code from the simulation notebook into a Python script, then set a breakpoint on the feasibility step and step through using the PyCharm debugger (which allows you to view DataFrames).
Clone this wiki locally