From d746238f92790e4836627022a702093103263373 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Tue, 7 Apr 2020 21:18:08 -0700 Subject: [PATCH 01/12] Fixing an int32-int64 mismatch --- baus/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/baus/models.py b/baus/models.py index d882c461b..1c18f6fc1 100644 --- a/baus/models.py +++ b/baus/models.py @@ -338,7 +338,8 @@ def household_relocation(households, household_relocation_rates, # set households that are moving to a building_id of -1 (means unplaced) households.update_col_from_series("building_id", - pd.Series(-1, index=index).astype('int')) + pd.Series(-1, index=index), + cast = True) # this deviates from the step in urbansim_defaults only in how it deals with From 4e06ddb71c4f6ee43fe99241f8fc37deba9c343b Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Tue, 7 Apr 2020 21:38:57 -0700 Subject: [PATCH 02/12] Changing injectable from 'settings' to 'policy' --- baus/summaries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baus/summaries.py b/baus/summaries.py index 8c1f4e152..04f567361 100644 --- a/baus/summaries.py +++ b/baus/summaries.py @@ -273,7 +273,7 @@ def policy_activated(policy_loc, policy_nm, scenario): counties = ["alameda", "contra_costa", "marin", "napa", "san_mateo", "san_francisco", "santa_clara", "solano", "sonoma"] for county in counties: - policy_loc = (settings["acct_settings"]["lump_sum_accounts"] + policy_loc = (policy["acct_settings"]["lump_sum_accounts"] [county+"_bond_settings"]["enable_in_scenarios"]) if scenario in policy_loc: counter += 1 From f4692d79deb0c5c2e22c3e8b9e7205a1731bed8a Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Tue, 7 Apr 2020 22:26:18 -0700 Subject: [PATCH 03/12] Pandana aggregation 'average' -> 'ave' --- configs/neighborhood_vars.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 From 73243ca5f1adc4e5ac873ca75daa7f1ac0f4f3b0 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 16 Apr 2020 09:29:14 -0700 Subject: [PATCH 04/12] Updating requirements file --- requirements-2019.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements-2019.txt b/requirements-2019.txt index 2ade63a7f..0d82ee3dc 100644 --- a/requirements-2019.txt +++ b/requirements-2019.txt @@ -1,8 +1,9 @@ -# 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.* +numpy == 1.16.* pandas == 0.25.* orca == 1.5.* From b6a0d32f8a2a8f1b5dd8e7be247aad4add9725b7 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Thu, 16 Apr 2020 09:46:54 -0700 Subject: [PATCH 05/12] Adding conda environment --- baus-env-2020.yml | 24 ++++++++++++++++++++++++ requirements-2019.txt | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 baus-env-2020.yml diff --git a/baus-env-2020.yml b/baus-env-2020.yml new file mode 100644 index 000000000..d8de1a1d0 --- /dev/null +++ b/baus-env-2020.yml @@ -0,0 +1,24 @@ +# 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 # for orca, pandana + +dependencies: + - python=3.6 + - numpy=1.17 + - orca=1.5 + - pandana=0.4 + - pandas=0.25 + - pip + - scikit-learn=0.22 + - statsmodels=0.11 + + - pip: + - orca_test==0.1.* + - urbansim==3.1.* + - urbansim_defaults==0.2.* diff --git a/requirements-2019.txt b/requirements-2019.txt index 0d82ee3dc..5d095121e 100644 --- a/requirements-2019.txt +++ b/requirements-2019.txt @@ -4,7 +4,8 @@ # Install with: pip install -r requirements-2019.txt numpy == 1.16.* -pandas == 0.25.* +pandas == 0.24.* +statsmodels == 0.10.* orca == 1.5.* orca_test == 0.1.* From 670703c886448c0be9407e63db9719b52f73ae5d Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 29 Apr 2020 11:04:41 -0700 Subject: [PATCH 06/12] Adding boto to env for aws download --- baus-env-2020.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/baus-env-2020.yml b/baus-env-2020.yml index d8de1a1d0..c22a71710 100644 --- a/baus-env-2020.yml +++ b/baus-env-2020.yml @@ -10,6 +10,7 @@ channels: dependencies: - python=3.6 + - boto=2.49 - numpy=1.17 - orca=1.5 - pandana=0.4 From e5c7ce01ecd829e019788f72da631fc2f7201213 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 29 Apr 2020 12:16:14 -0700 Subject: [PATCH 07/12] Removing boto again, since we're not currently using aws --- baus-env-2020.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/baus-env-2020.yml b/baus-env-2020.yml index c22a71710..d8de1a1d0 100644 --- a/baus-env-2020.yml +++ b/baus-env-2020.yml @@ -10,7 +10,6 @@ channels: dependencies: - python=3.6 - - boto=2.49 - numpy=1.17 - orca=1.5 - pandana=0.4 From 397924e65ae493a83a88f12b89415c4debe21283 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 13 May 2020 09:42:34 -0700 Subject: [PATCH 08/12] Updating environment with urbansim 3.2 --- baus-env-2020.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/baus-env-2020.yml b/baus-env-2020.yml index d8de1a1d0..ba95b96ea 100644 --- a/baus-env-2020.yml +++ b/baus-env-2020.yml @@ -6,19 +6,16 @@ name: baus-env-2020 channels: - - conda-forge # for orca, pandana + - conda-forge dependencies: - python=3.6 - numpy=1.17 - orca=1.5 + - orca_test=0.1 - pandana=0.4 - pandas=0.25 - - pip - scikit-learn=0.22 - statsmodels=0.11 - - - pip: - - orca_test==0.1.* - - urbansim==3.1.* - - urbansim_defaults==0.2.* + - urbansim=3.2 + - urbansim_defaults=0.2 From 9998d35b44c4a6021297cb346851f4d635815a85 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 13 May 2020 11:41:41 -0700 Subject: [PATCH 09/12] Updating installation instructions --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 738d7bd05..8806850d3 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,18 @@ 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 MacOS, 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 easy and 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. Run the model: `python baus.py` + +More info about the command line arguments: `python baus.py --help` ### An overview of baus.py From 2393abaa781927d0fa73102b8f96a5b61d07c8cb Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 13 May 2020 11:44:22 -0700 Subject: [PATCH 10/12] Updating installation instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8806850d3..6e8a1e70b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This is the DRAFT UrbanSim implementation for the Bay Area. Policy documentation Bay Area UrbanSim is written in Python and runs in a command line environment. It's compatible with MacOS, 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 easy and reliable) +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` From d931fb3497a9d280154567dc28796e08688cdde2 Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 13 May 2020 12:53:20 -0700 Subject: [PATCH 11/12] Updating installation instructions --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e8a1e70b..5ad4c338b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ Bay Area UrbanSim is written in Python and runs in a command line environment. I 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. Run the model: `python baus.py` +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` From 1c021eb87d56fc31112d6325fe061b310972333f Mon Sep 17 00:00:00 2001 From: Sam Maurer Date: Wed, 13 May 2020 13:56:35 -0700 Subject: [PATCH 12/12] Updating installation instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ad4c338b..07e9a3e24 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is the DRAFT UrbanSim implementation for the Bay Area. Policy documentation ### Installation -Bay Area UrbanSim is written in Python and runs in a command line environment. It's compatible with MacOS, Windows, and Linux, and with Python 2.7 and 3.5+. Python 3 is recommended. +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