Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated environment and Pandana 0.4 compatibility #129

Merged
merged 13 commits into from
May 18, 2020
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ DRAFT Bay Area UrbanSim (BAUS) Implementation

This is the DRAFT UrbanSim implementation for the Bay Area. Policy documentation for the Bay Area model is available [here](http://data.mtc.ca.gov/bayarea_urbansim/) and documentation for the UrbanSim framework is available [here](https://udst.github.io/urbansim/).

* Install Python for your OS ([Anaconda](https://www.continuum.io/downloads) highly suggested)
* Clone this repository
* Install dependencies using `pip install -r requirements.txt` (may need to uncomment out pandana)
* Get data using `python baus.py -c --mode fetch_data` (you will need an appropriately configured AWS credentials file which you must get from your MTC contact)
* Preprocess data using `python baus.py -c --mode preprocessing`
* Run a simulation using `python baus.py -c` (default mode is simulation)
### Installation

Bay Area UrbanSim is written in Python and runs in a command line environment. It's compatible with Mac, Windows, and Linux, and with Python 2.7 and 3.5+. Python 3 is recommended.

1. Install the [Anaconda Python](https://www.anaconda.com/products/individual#Downloads) distribution (not strictly required, but makes things easier and more reliable)
2. Clone this repository
3. Download base data from this [Box folder](https://app.box.com/folder/52679598048) and move the files to `bayarea_urbansim/data/` (ask an MTC contact for access)
3. Create a Python environment with the current dependencies: `conda env create -f baus-env-2020.yml`
4. Activate the environment: `conda activate baus-env-2020`
5. Pre-process the base data: `python baus.py --mode preprocessing` (only needed once)
6. Run the model: `python baus.py`

More info about the command line arguments: `python baus.py --help`

### An overview of baus.py

Expand Down
21 changes: 21 additions & 0 deletions baus-env-2020.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This environment pins dependencies at specific versions, to ensure consistent model
# behavior. It also pins some of the more important sub-dependencies.

# Install this environment by running `conda env create -f baus-env-2020.yml`

name: baus-env-2020

channels:
- conda-forge

dependencies:
- python=3.6
- numpy=1.17
- orca=1.5
- orca_test=0.1
- pandana=0.4
- pandas=0.25
- scikit-learn=0.22
- statsmodels=0.11
- urbansim=3.2
- urbansim_defaults=0.2
6 changes: 3 additions & 3 deletions configs/neighborhood_vars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ variable_definitions:
radius: 1500
apply: np.log1p
decay: flat
aggregation: average
aggregation: ave

- name: ave_lot_size_per_unit
dataframe: buildings
Expand All @@ -78,7 +78,7 @@ variable_definitions:
radius: 1500
apply: np.log1p
decay: flat
aggregation: average
aggregation: ave

- name: population
filters:
Expand Down Expand Up @@ -116,7 +116,7 @@ variable_definitions:
- building_id != -1
varname: persons
radius: 1500
aggregation: average
aggregation: ave
decay: flat
apply: np.log1p

Expand Down
8 changes: 5 additions & 3 deletions requirements-2019.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# This environment pins requirements at their versions as of 10-2019
# This environment pins requirements at their versions as of Oct-2019, updated Apr-2020
# Compatible with both Python 2.7 and 3.6+

# Install with: pip install -r requirements-2019.txt

numpy == 1.17.*
pandas == 0.25.*
numpy == 1.16.*
pandas == 0.24.*
statsmodels == 0.10.*

orca == 1.5.*
orca_test == 0.1.*
Expand Down