Skip to content

Commit

Permalink
Merge pull request #95 from RSGInc/asim_transfer
Browse files Browse the repository at this point in the history
Transfer PopulationSim to ActivitySim org
  • Loading branch information
bstabler authored Dec 16, 2019
2 parents c6dff05 + e40a4bd commit 8383c65
Show file tree
Hide file tree
Showing 12 changed files with 349 additions and 111 deletions.
22 changes: 16 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ sudo: false

python:
- '2.7'
- '3.5'
- '3.6'
- '3.7'

Expand All @@ -15,19 +14,30 @@ install:
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION cytoolz numpy pandas pip pytables
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION future
- source activate test-environment
- pip install orca openmatrix zbox psutil
- pip install ortools
- pip install pytest pytest-cov coveralls pycodestyle
- pip install activitysim
- pip install .
script:
- pycodestyle populationsim
- py.test --cov populationsim --cov-report term-missing
after_success:
- coveralls
- bin/build_docs.sh
# Build docs
- pip install sphinx numpydoc sphinx_rtd_theme
- cd docs
- make clean
- make html
- touch _build/html/.nojekyll

deploy:
provider: pages
local_dir: docs/_build/html
skip_cleanup: true
github_token: $GH_TOKEN
keep_history: true
on:
branch: master

notifications:
slack:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
PopulationSim
=============

[![Build Status](https://travis-ci.org/RSGInc/populationsim.svg?branch=master)](https://travis-ci.org/RSGInc/populationsim) [![Coverage Status](https://coveralls.io/repos/RSGInc/populationsim/badge.png?branch=master)](https://coveralls.io/r/RSGInc/populationsim?branch=master)
[![Build Status](https://travis-ci.org/activitysim/populationsim.svg?branch=master)](https://travis-ci.org/ActivitySim/populationsim) [![Coverage Status](https://coveralls.io/repos/activitysim/populationsim/badge.png?branch=master)](https://coveralls.io/r/ActivitySim/populationsim?branch=master)


PopulationSim is an open platform for population synthesis. It emerged
from Oregon DOT's desire to build a shared, open, platform that could be
easily adapted for statewide, regional, and urban transportation planning
needs. PopulationSim is implemented in the
[ActivitySim](https://github.com/activitysim/activitysim) framework.
from Oregon DOT's desire to build a shared, open, platform that could be
easily adapted for statewide, regional, and urban transportation planning
needs. PopulationSim is implemented in the
[ActivitySim](https://github.com/activitysim/activitysim) framework.

## Documentation

https://rsginc.github.io/populationsim/
https://activitysim.github.io/populationsim/
63 changes: 0 additions & 63 deletions bin/build_docs.sh

This file was deleted.

2 changes: 1 addition & 1 deletion docs/application_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ versions, and then add the error to the largest category by subtracting it from
Configuration
-------------

Below is PopulationSim's directory structure followed by a description of inputs. To set up a PopulationSim run, the user must create the `example directory structure <https://github.com/RSGInc/populationSim_resources/raw/master/example_setup/PopulationSimExampleSetUps.7z>`_
Below is PopulationSim's directory structure followed by a description of inputs.

.. image:: images/PopulationSimFolderStructure.png

Expand Down
19 changes: 11 additions & 8 deletions docs/docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
.. _docs:

Documents & Resources
ActivitySim Resources
=====================

1. `PopulationSim Specification <https://github.com/RSGInc/populationSim_resources/raw/master/papers/Draft%20TM1%20-%20Population%20Synthesis%20Technical%20Specifications%202017-03-08.pdf>`_
1. `PopulationSim Repository <https://github.com/ActivitySim/populationsim>`_

2. `2018 TRB paper <https://github.com/RSGInc/populationSim_resources/raw/master/papers/TRB_Paper_PopulationSim_v6.pdf>`_
2. `ActivitySim Project <http://www.activitysim.org>`_

3. `2018 TRB poster <https://github.com/RSGInc/populationSim_resources/raw/master/papers/TRBPoster_PaulDoyleStablerFreedmanBettinardi_v5%5B1%5D.pptx>`_
External Resources
==================

4. `PopulationSim Software Repository <https://github.com/RSGInc/populationsim>`_
1. `ODOT PopulationSim Specification <https://github.com/RSGInc/odot_populationSim_resources/raw/master/papers/Draft%20TM1%20-%20Population%20Synthesis%20Technical%20Specifications%202017-03-08.pdf>`_

5. `PopulationSim Resources Repository (additional resources such as papers, setups, examples) <https://github.com/RSGInc/populationsim_resources>`_
2. `ODOT 2018 TRB paper <https://github.com/RSGInc/odot_populationSim_resources/raw/master/papers/TRB_Paper_PopulationSim_v6.pdf>`_

6. `Complete Python 2 setup for PopulationSim <https://github.com/RSGInc/populationsim_python/archive/master.zip>`_
3. `ODOT 2018 TRB poster <https://github.com/RSGInc/odot_populationSim_resources/raw/master/papers/TRBPoster_PaulDoyleStablerFreedmanBettinardi_v5%5B1%5D.pptx>`_

7. `ActivitySim Project <http://www.activitysim.org>`_
4. `ODOT Resources Repository (setups, examples) <https://github.com/RSGInc/odot_populationsim_resources>`_

5. `ODOT Complete Python 2 setup for PopulationSim <https://github.com/RSGInc/odot_populationsim_python/archive/master.zip>`_
22 changes: 4 additions & 18 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,11 @@ Installation
#Mac
conda activate popsim

4. Get and install other required libraries, which can be found online. Run the following command on the activated conda Python environment:
4. Get and install the PopulationSim package on the activated conda Python environment:

::

conda install cytoolz numpy pandas psutil pytables future

5. If you access the internet from behind a firewall, then you will need to configure your proxy server when downloading packages. For example:

::

pip install --trusted-host pypi.python.org --proxy=myproxy.org:8080 activitysim

6. Get and install the PopulationSim package on the activated conda Python environment:

::

pip install https://github.com/RSGInc/populationsim/zipball/master
pip install populationsim


.. _anaconda_notes :
Expand Down Expand Up @@ -81,8 +69,6 @@ Run Examples

* Before running examples, ensure that Anaconda Python, dependent libraries and PopulationSim package have been installed.

* Download and unzip the `example setups <https://github.com/RSGInc/populationSim_resources/raw/master/example_setup/PopulationSimExampleSetUpsPython3.zip>`_ to a folder on your computer. It does not have to be the same directory as your Anaconda or PopulationSim install.

There are three examples for running PopulationSim, two created using data from the Corvallis-Albany-Lebanon Modeling (CALM) region in Oregon and the other using data from the Metro Vancouver region in British Columbia. The `example_calm`_ set-up runs PopulationSim in base mode, where a synthetic population is created for the entire modeling region. This takes approximately 12 minutes on a laptop with an Intel i7-4800MQ CPU @ 2.70GHz and 16 GB of RAM. The `example_calm_repop`_ set-up runs PopulationSim in the *repop* mode, which updates the synthetic population for a small part of the region. The `example_survey_weighting`_ set-up runs PopulationSim for the case of developing final weights for a household travel survey. More information on the configuration of PopulationSim can be found in the **Application & Configuration** section.

Example_calm
Expand Down Expand Up @@ -116,8 +102,8 @@ The repop configuration requires outputs from a base run. Therefore, the base co

* Review the outputs in the *output* folder

Example_weighting
~~~~~~~~~~~~~~~~~~
Example_survey_weighting
~~~~~~~~~~~~~~~~~~~~~~~~

Follow the steps below to run **example_survey_weighting** set up:

Expand Down
1 change: 1 addition & 0 deletions docs/software.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,4 @@ Release Notes
* v0.3.3 - add disgnostic printouts on assert fail in mult_integerizer
* v0.3.4 - add survey weighting use case
* v0.3.5 - add Python 3.5+ support
* v0.4 - transfer to ActivitySim.org
2 changes: 1 addition & 1 deletion docs/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Validation of Results

One of the most critical steps in the population synthesis procedure is the validation of the synthetic population. Validation can give us clues about inconsistencies among controls, data processing errors or misspecification of settings. This section provides general guidelines on validation procedures.

PopulationSim reports the difference between the synthesized totals and the control totals for all the controls at each geographic level. User can select these summaries using the ``output_tables:`` token as described in the :ref:`settings` section. The :ref:`inputs_outputs` section lists all the summaries available to user. Most population synthesizers will match each control very well at a regional level; therefore such summaries are useful but not very insightful into the goodness-of-fit of the tool at lower level geographies. Users can download an R-based `validation script <https://github.com/RSGInc/populationSim_resources/raw/master/validation_scripts/validation_scripts.7z>`_ to generate advanced summary statistics and validation plots. This *validation script* takes summaries and outputs from a PopulationSim run to generate plots and advanced summaries. The script is configured to run for the CALM region example and includes notes on inputs and configuration settings. To download and run the CALM region example refer to the :ref:`getting_started` section.
PopulationSim reports the difference between the synthesized totals and the control totals for all the controls at each geographic level. User can select these summaries using the ``output_tables:`` token as described in the :ref:`settings` section. The :ref:`inputs_outputs` section lists all the summaries available to user. Most population synthesizers will match each control very well at a regional level; therefore such summaries are useful but not very insightful into the goodness-of-fit of the tool at lower level geographies. Users can download a `validation script <https://github.com/activitysim/populationSim/tree/master/scripts>`_ to generate advanced summary statistics and validation plots. This *validation script* takes summaries and outputs from a PopulationSim run to generate plots and advanced summaries. The script is configured to run for the CALM region example and includes notes on inputs and configuration settings. To download and run the CALM region example refer to the :ref:`getting_started` section.


Validation Summary Statistics
Expand Down
5 changes: 5 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

## Scripts

- validationPopulationSim.R - R validation script to generate advanced summary statistics and validation plots. This validation script takes summaries and outputs from a PopulationSim run. The script is configured to run for the CALM region example and includes notes on inputs and configuration settings
- columnMapPopSim_CALM.csv - CSV file to specify the controls for which the summaries should be generated
32 changes: 32 additions & 0 deletions scripts/columnMapPopSim_CALM.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
NAME,GEOGRAPHY,CONTROL,SUMMARY
TAZ - Total Households,TAZ,num_hh_control,num_hh_result
TAZ - Household Size: 1 person HH,TAZ,hh_size_1_control,hh_size_1_result
TAZ - Household Size: 2 person HH,TAZ,hh_size_2_control,hh_size_2_result
TAZ - Household Size: 3 person HH,TAZ,hh_size_3_control,hh_size_3_result
TAZ - Household Size: 4+ person HH,TAZ,hh_size_4_plus_control,hh_size_4_plus_result
TAZ - Householder Age: 15-24 years,TAZ,hh_age_15_24_control,hh_age_15_24_result
TAZ - Householder Age: 25-54 years,TAZ,hh_age_25_54_control,hh_age_25_54_result
TAZ - Householder Age: 55-64 years,TAZ,hh_age_55_64_control,hh_age_55_64_result
TAZ - Householder Age: >65 years,TAZ,hh_age_65_plus_control,hh_age_65_plus_result
"TAZ - Household Income: (-Inf,21297)",TAZ,hh_inc_15_control,hh_inc_15_result
"TAZ - Household Income: [21297,42593)",TAZ,hh_inc_15_30_control,hh_inc_15_30_result
"TAZ - Household Income: [42593,85185)",TAZ,hh_inc_30_60_control,hh_inc_30_60_result
"TAZ - Household Income: [85185,+Inf)",TAZ,hh_inc_60_plus_control,hh_inc_60_plus_result
TAZ - Students by family,TAZ,students_by_family_housing_type_control,students_by_family_housing_type_result
TAZ - Students by non-family,TAZ,students_by_nonfamily_housing_type_control,students_by_nonfamily_housing_type_result
TRACT - SF,TRACT,hh_by_type_sf_control,hh_by_type_sf_result
TRACT - MF,TRACT,hh_by_type_mf_control,hh_by_type_mf_result
TRACT - MH,TRACT,hh_by_type_mh_control,hh_by_type_mh_result
TRACT - Dup,TRACT,hh_by_type_dup_control,hh_by_type_dup_result
TRACT - Household Workers: 0 worker HH,TRACT,hh_wrks_0_control,hh_wrks_0_result
TRACT - Household Workers: 1 worker HH,TRACT,hh_wrks_1_control,hh_wrks_1_result
TRACT - Household Workers: 2 worker HH,TRACT,hh_wrks_2_control,hh_wrks_2_result
TRACT - Household Workers: 3+ worker HH,TRACT,hh_wrks_3_plus_control,hh_wrks_3_plus_result
REGION - Occupation Type 1,REGION,persons_occ_1_control,persons_occ_1_result
REGION - Occupation Type 2,REGION,persons_occ_2_control,persons_occ_2_result
REGION - Occupation Type 3,REGION,persons_occ_3_control,persons_occ_3_result
REGION - Occupation Type 4,REGION,persons_occ_4_control,persons_occ_4_result
REGION - Occupation Type 5,REGION,persons_occ_5_control,persons_occ_5_result
REGION - Occupation Type 6,REGION,persons_occ_6_control,persons_occ_6_result
REGION - Occupation Type 7,REGION,persons_occ_7_control,persons_occ_7_result
REGION - Occupation Type 8,REGION,persons_occ_8_control,persons_occ_8_result
Loading

0 comments on commit 8383c65

Please sign in to comment.