cml-pam


Namecml-pam JSON
Version 0.3.2 PyPI version JSON
download
home_pageNone
SummaryThe Population activity Modeller (PAM) is a python API for activity sequence modelling.
upload_time2024-04-05 21:28:18
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords agent-based modelling sequence model matsim
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!--- the "--8<--" html comments define what part of the README to add to the index page of the documentation -->
<!--- --8<-- [start:docs] -->

![PAM](resources/logos/title.png)

# Population Activity Modeller

![DailyCIbadge](https://github.com/arup-group/pam/actions/workflows/daily-scheduled-ci.yml/badge.svg)
[![](https://github.com/arup-group/pam/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://arup-group.github.io/pam)
[![image](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/arupcitymodelling/pandemic-activity-modifier-intro-3d2dccbc716e)

PAM is a python library for population **activity sequence** modelling. Example use cases:

- **Read** an existing population then **write** to a new format.
- **Modify** an existing population, for example to model activity locations.
- **Create** your own activity-based model.

PAM supports common travel and activity formats, including MATSim.

## Activity Sequences?

Population **activity sequences** (sometimes called **activity plans**) are used to model the activities (where and when people are at home, work, education and so on) and associated travel of a population:

 ![PAM](resources/example-activity-plans.png)

Activity sequences are used by transport planners to model travel demand, but can also be used in other domains, such as for virus transmission or energy use modelling.

## Brief History

PAM was originally built and shared to rapidly modify existing activity models to respond to pandemic lock-down scenarios.

 ![PAM](resources/PAM-motivation.png)

This functionality used a **read-modify-write** pattern. Where modifications are made by applying **policies**. Example policies might be (a) infected persons quarantine at home, (b) only critical workers travel to work, and (c) everyone shops locally.

![PAM](resources/PAM-features.png)

## Features

### Activity Modelling

In addition to the original **read-modify-write** pattern and functionality, PAM has modules for:

- location modelling
- discretionary activity modelling
- mode choice modelling
- facility sampling
- vehicle ownership

More generally the core PAM data structure and modules can be used as a library to support your own use cases, including building your own activity-based model.

### MATSim

PAM fully supports the [MATSim](https://www.matsim.org/) population/plans format. This includes vehicles, unselected plans, leg routes and leg attributes. A core use case of PAM is to ***read-modify-write*** *experienced plans* from MATSim. This can allow new MATSim scenarios to be *"warm started"* from existing scenarios, significantly reducing MATSim compute time.

<!--- --8<-- [end:docs] -->
## Documentation

For more detailed instructions, see our [documentation](https://arup-group.github.io/pam/latest).

## Installation

To install PAM, we recommend using the [mamba](https://mamba.readthedocs.io/en/latest/index.html) package manager:

### As a user
<!--- --8<-- [start:docs-install-user] -->
``` shell
mamba create -n pam -c conda-forge -c city-modelling-lab cml-pam
mamba activate pam
```
<!--- --8<-- [end:docs-install-user] -->
### As a developer
<!--- --8<-- [start:docs-install-dev] -->
``` shell
git clone git@github.com:arup-group/pam.git
cd pam
mamba create -n pam -c conda-forge -c city-modelling-lab --file requirements/base.txt --file requirements/dev.txt
mamba activate pam
pip install --no-deps -e .
```
<!--- --8<-- [end:docs-install-dev] -->

### Installing with pip

Installing directly with pip as a user (`pip install cml-pam`) or as a developer (`pip install -e '.[dev]'`) is also possible, but you will need the `libgdal` & `libspatialindex` geospatial non-python libraries pre-installed.

For more detailed instructions, see our [documentation](https://arup-group.github.io/pam/latest/installation/).

## Contributing

There are many ways to make both technical and non-technical contributions to PAM.
Before making contributions to the PAM source code, see our contribution guidelines and follow the [development install instructions](#as-a-developer).

If you are using `pip` to install PAM instead of the recommended `mamba`, you can install the optional test and documentation libraries using the `dev` option, i.e., `pip install -e '.[dev]'`

If you plan to make changes to the code then please make regular use of the following tools to verify the codebase while you work:

- `pre-commit`: run `pre-commit install` in your command line to load inbuilt checks that will run every time you commit your changes.
The checks are: 1. check no large files have been staged, 2. lint python files for major errors, 3. format python files to conform with the [pep8 standard](https://peps.python.org/pep-0008/).
You can also run these checks yourself at any time to ensure staged changes are clean by simple calling `pre-commit`.
- `pytest` - run the unit test suite, check test coverage, and test that the example notebooks successfully run.
- `pytest -p memray -m "high_mem" --no-cov` (not available on Windows) - after installing memray (`mamba install memray pytest-memray`), test that memory and time performance does not exceed benchmarks.

For more information, see our [documentation](https://arup-group.github.io/pam/latest/contributing/coding/).

## Building the documentation

If you are unable to access the online documentation, you can build the documentation locally.
First, [install a development environment of PAM](https://arup-group.github.io/pam/latest/contributing/coding/), then deploy the documentation using [mike](https://github.com/jimporter/mike):

```
mike deploy 0.2
mike serve
```

Then you can view the documentation in a browser at <http://localhost:8000/>.

## Credits

This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [arup-group/cookiecutter-pypackage](https://github.com/arup-group/cookiecutter-pypackage) project template.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cml-pam",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Michael Fitzmaurice <michael.fitzmaurice@arup.com>, Kasia Kozlowska <kasia.kozlowska@arup.com>, Theodore Chatziioannou <theodore.chatziioannou@arup.com>, Bryn Pickering <17178478+brynpickering@users.noreply.github.com>",
    "keywords": "agent-based modelling, sequence model, matsim",
    "author": null,
    "author_email": "Fred Shone <fred.shone@arup.com>",
    "download_url": "https://files.pythonhosted.org/packages/b8/ce/9ab083436a9c0576768b6ed3dc1ade49c4a9e4de25e17088a3c37fffc02b/cml-pam-0.3.2.tar.gz",
    "platform": null,
    "description": "<!--- the \"--8<--\" html comments define what part of the README to add to the index page of the documentation -->\n<!--- --8<-- [start:docs] -->\n\n![PAM](resources/logos/title.png)\n\n# Population Activity Modeller\n\n![DailyCIbadge](https://github.com/arup-group/pam/actions/workflows/daily-scheduled-ci.yml/badge.svg)\n[![](https://github.com/arup-group/pam/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://arup-group.github.io/pam)\n[![image](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/arupcitymodelling/pandemic-activity-modifier-intro-3d2dccbc716e)\n\nPAM is a python library for population **activity sequence** modelling. Example use cases:\n\n- **Read** an existing population then **write** to a new format.\n- **Modify** an existing population, for example to model activity locations.\n- **Create** your own activity-based model.\n\nPAM supports common travel and activity formats, including MATSim.\n\n## Activity Sequences?\n\nPopulation **activity sequences** (sometimes called **activity plans**) are used to model the activities (where and when people are at home, work, education and so on) and associated travel of a population:\n\n ![PAM](resources/example-activity-plans.png)\n\nActivity sequences are used by transport planners to model travel demand, but can also be used in other domains, such as for virus transmission or energy use modelling.\n\n## Brief History\n\nPAM was originally built and shared to rapidly modify existing activity models to respond to pandemic lock-down scenarios.\n\n ![PAM](resources/PAM-motivation.png)\n\nThis functionality used a **read-modify-write** pattern. Where modifications are made by applying **policies**. Example policies might be (a) infected persons quarantine at home, (b) only critical workers travel to work, and (c) everyone shops locally.\n\n![PAM](resources/PAM-features.png)\n\n## Features\n\n### Activity Modelling\n\nIn addition to the original **read-modify-write** pattern and functionality, PAM has modules for:\n\n- location modelling\n- discretionary activity modelling\n- mode choice modelling\n- facility sampling\n- vehicle ownership\n\nMore generally the core PAM data structure and modules can be used as a library to support your own use cases, including building your own activity-based model.\n\n### MATSim\n\nPAM fully supports the [MATSim](https://www.matsim.org/) population/plans format. This includes vehicles, unselected plans, leg routes and leg attributes. A core use case of PAM is to ***read-modify-write*** *experienced plans* from MATSim. This can allow new MATSim scenarios to be *\"warm started\"* from existing scenarios, significantly reducing MATSim compute time.\n\n<!--- --8<-- [end:docs] -->\n## Documentation\n\nFor more detailed instructions, see our [documentation](https://arup-group.github.io/pam/latest).\n\n## Installation\n\nTo install PAM, we recommend using the [mamba](https://mamba.readthedocs.io/en/latest/index.html) package manager:\n\n### As a user\n<!--- --8<-- [start:docs-install-user] -->\n``` shell\nmamba create -n pam -c conda-forge -c city-modelling-lab cml-pam\nmamba activate pam\n```\n<!--- --8<-- [end:docs-install-user] -->\n### As a developer\n<!--- --8<-- [start:docs-install-dev] -->\n``` shell\ngit clone git@github.com:arup-group/pam.git\ncd pam\nmamba create -n pam -c conda-forge -c city-modelling-lab --file requirements/base.txt --file requirements/dev.txt\nmamba activate pam\npip install --no-deps -e .\n```\n<!--- --8<-- [end:docs-install-dev] -->\n\n### Installing with pip\n\nInstalling directly with pip as a user (`pip install cml-pam`) or as a developer (`pip install -e '.[dev]'`) is also possible, but you will need the `libgdal` & `libspatialindex` geospatial non-python libraries pre-installed.\n\nFor more detailed instructions, see our [documentation](https://arup-group.github.io/pam/latest/installation/).\n\n## Contributing\n\nThere are many ways to make both technical and non-technical contributions to PAM.\nBefore making contributions to the PAM source code, see our contribution guidelines and follow the [development install instructions](#as-a-developer).\n\nIf you are using `pip` to install PAM instead of the recommended `mamba`, you can install the optional test and documentation libraries using the `dev` option, i.e., `pip install -e '.[dev]'`\n\nIf you plan to make changes to the code then please make regular use of the following tools to verify the codebase while you work:\n\n- `pre-commit`: run `pre-commit install` in your command line to load inbuilt checks that will run every time you commit your changes.\nThe checks are: 1. check no large files have been staged, 2. lint python files for major errors, 3. format python files to conform with the [pep8 standard](https://peps.python.org/pep-0008/).\nYou can also run these checks yourself at any time to ensure staged changes are clean by simple calling `pre-commit`.\n- `pytest` - run the unit test suite, check test coverage, and test that the example notebooks successfully run.\n- `pytest -p memray -m \"high_mem\" --no-cov` (not available on Windows) - after installing memray (`mamba install memray pytest-memray`), test that memory and time performance does not exceed benchmarks.\n\nFor more information, see our [documentation](https://arup-group.github.io/pam/latest/contributing/coding/).\n\n## Building the documentation\n\nIf you are unable to access the online documentation, you can build the documentation locally.\nFirst, [install a development environment of PAM](https://arup-group.github.io/pam/latest/contributing/coding/), then deploy the documentation using [mike](https://github.com/jimporter/mike):\n\n```\nmike deploy 0.2\nmike serve\n```\n\nThen you can view the documentation in a browser at <http://localhost:8000/>.\n\n## Credits\n\nThis package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [arup-group/cookiecutter-pypackage](https://github.com/arup-group/cookiecutter-pypackage) project template.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The Population activity Modeller (PAM) is a python API for activity sequence modelling.",
    "version": "0.3.2",
    "project_urls": {
        "changelog": "https://github.com/arup-group/pam/blob/main/CHANGELOG.md",
        "documentation": "https://arup-group.github.io/pam",
        "repository": "https://github.com/arup-group/pam"
    },
    "split_keywords": [
        "agent-based modelling",
        " sequence model",
        " matsim"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70fff9aee4b5210dc636555bf37efde3cfe9b63a92eb5162bc1a4bea49dac371",
                "md5": "ccbe89092d3178b7a1fde239bc65cbfb",
                "sha256": "63c6002afc6427f1327026594308f49e2cab942276a0aca044bb617c5325a217"
            },
            "downloads": -1,
            "filename": "cml_pam-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ccbe89092d3178b7a1fde239bc65cbfb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 128599,
            "upload_time": "2024-04-05T21:28:17",
            "upload_time_iso_8601": "2024-04-05T21:28:17.229387Z",
            "url": "https://files.pythonhosted.org/packages/70/ff/f9aee4b5210dc636555bf37efde3cfe9b63a92eb5162bc1a4bea49dac371/cml_pam-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8ce9ab083436a9c0576768b6ed3dc1ade49c4a9e4de25e17088a3c37fffc02b",
                "md5": "0986001b8f89fd5fc35f617870affceb",
                "sha256": "55120c7f2b2fb5c38f6017f148b769d34af75998df82e0cb1780eaf1c6054d78"
            },
            "downloads": -1,
            "filename": "cml-pam-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "0986001b8f89fd5fc35f617870affceb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 165905,
            "upload_time": "2024-04-05T21:28:18",
            "upload_time_iso_8601": "2024-04-05T21:28:18.724004Z",
            "url": "https://files.pythonhosted.org/packages/b8/ce/9ab083436a9c0576768b6ed3dc1ade49c4a9e4de25e17088a3c37fffc02b/cml-pam-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-05 21:28:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "arup-group",
    "github_project": "pam",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cml-pam"
}
        
Elapsed time: 0.25106s