diff --git a/README.md b/README.md index 738d7bd05..07e9a3e24 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/baus-env-2020.yml b/baus-env-2020.yml new file mode 100644 index 000000000..ba95b96ea --- /dev/null +++ b/baus-env-2020.yml @@ -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 diff --git a/configs/neighborhood_vars.yaml b/configs/neighborhood_vars.yaml index 17b0131a5..1fcebb148 100644 --- a/configs/neighborhood_vars.yaml +++ b/configs/neighborhood_vars.yaml @@ -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 @@ -78,7 +78,7 @@ variable_definitions: radius: 1500 apply: np.log1p decay: flat - aggregation: average + aggregation: ave - name: population filters: @@ -116,7 +116,7 @@ variable_definitions: - building_id != -1 varname: persons radius: 1500 - aggregation: average + aggregation: ave decay: flat apply: np.log1p diff --git a/requirements-2019.txt b/requirements-2019.txt index 2ade63a7f..5d095121e 100644 --- a/requirements-2019.txt +++ b/requirements-2019.txt @@ -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.*