Software Implementation ======================= This page describes the bca4abm software implementation and how to contribute. The implementation starts with the ActivitySim framework, which serves as the foundation for the software. The framework, as briefly described below, includes features for data pipeline management, expression handling, testing, etc. Built upon the framework are additional core components for benefits calculation. ActivitySim Framework --------------------- bca4abm is implemented in the `ActivitySim `__ framework. As summarized `here `__, being implemented in the ActivitySim framework means: * Overall Design * Implemented in Python, and makes heavy use of the vectorized backend C/C++ libraries in `pandas `__ and `numpy `__. * Vectorization instead of for loops when possible * Runs sub-models that solve Python expression files that operate on data tables * Data Handling * Inputs are in CSV format, with the exception of settings * CSVs are read-in as pandas tables and stored in an intermediate HDF5 binary file that is used for data I/O throughout the model run * Key outputs are written to CSV files * Key Data Structures * `pandas.DataFrame `__ - A data table with rows and columns, similar to an R data frame, Excel worksheet, or database table * `pandas.Series `__ - a vector of data, a column in a DataFrame table or a 1D array * `numpy.array `__ - an N-dimensional array of items of the same type, such as a matrix * Model Orchestrator * `ORCA `__ is used for running the overall model system and for defining dynamic data tables, columns, and injectables (functions). ActivitySim wraps ORCA functionality to make a Data Pipeline tool, which allows for re-starting at any model step. * Expressions * Model expressions are in CSV files and contain Python expressions, mainly pandas/numpy expression that operate on the input data tables. This helps to avoid modifying Python code when making changes to the model calculations. * `Code Documentation `__ * Python code according to `pycodestyle `__ style guide * Written in `reStructuredText `__ markup, built with `Sphinx `__ and docstrings written in `numpydoc `__ * `Testing `__ * A protected master branch that can only be written to after tests have passed * `pytest `__ for tests * `TravisCI `__ for building and testing with each commit Common ------ Software components common to both ABM and four-step model usage. bca4abm ^^^^^^^ .. automodule:: bca4abm.bca4abm :members: aggregate_trips ^^^^^^^^^^^^^^^ .. automodule:: bca4abm.processors.aggregate_trips :members: link ^^^^ .. automodule:: bca4abm.processors.link :members: ABM Processors -------------- Software components for ABM model usage. abm_results ^^^^^^^^^^^ .. automodule:: bca4abm.processors.abm.abm_results :members: auto_ownership ^^^^^^^^^^^^^^ .. automodule:: bca4abm.processors.abm.auto_ownership :members: demographics ^^^^^^^^^^^^ .. automodule:: bca4abm.processors.abm.demographics :members: person_trips ^^^^^^^^^^^^ .. automodule:: bca4abm.processors.abm.person_trips :members: physical_activity ^^^^^^^^^^^^^^^^^ .. automodule:: bca4abm.processors.abm.physical_activity :members: Four Step Processors -------------------- Software components for four-step model usage. aggregate_demographics ^^^^^^^^^^^^^^^^^^^^^^ .. automodule:: bca4abm.processors.four_step.aggregate_demographics :members: aggregate_zone ^^^^^^^^^^^^^^ .. automodule:: bca4abm.processors.four_step.aggregate_zone :members: aggregate_od ^^^^^^^^^^^^ .. automodule:: bca4abm.processors.four_step.aggregate_od :members: Contribution Guidelines ----------------------- bca4abm development follows the same `development guidelines `__ as ActivitySim. Release Notes ------------- * v0.4 - first release * v0.5 - add Python 3.5+ support * v0.6 - update 4step example