{"id":24990181,"url":"https://github.com/arup-group/pam","last_synced_at":"2025-04-05T02:12:42.913Z","repository":{"id":37928589,"uuid":"251145759","full_name":"arup-group/pam","owner":"arup-group","description":"Generate and modify transport demand scenarios via a Python API.","archived":false,"fork":false,"pushed_at":"2025-01-06T16:27:25.000Z","size":283789,"stargazers_count":55,"open_issues_count":34,"forks_count":21,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-01-12T09:17:56.505Z","etag":null,"topics":["arup","city-modelling","city-modelling-lab","cml","transit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arup-group.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-29T22:15:32.000Z","updated_at":"2024-12-19T15:11:57.000Z","dependencies_parsed_at":"2023-09-26T10:04:34.606Z","dependency_job_id":"ff578c10-d892-41f1-9de4-fc718528186f","html_url":"https://github.com/arup-group/pam","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arup-group%2Fpam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arup-group%2Fpam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arup-group%2Fpam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arup-group%2Fpam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arup-group","download_url":"https://codeload.github.com/arup-group/pam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arup","city-modelling","city-modelling-lab","cml","transit"],"created_at":"2025-02-04T13:34:46.522Z","updated_at":"2025-04-05T02:12:42.896Z","avatar_url":"https://github.com/arup-group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--- the \"--8\u003c--\" html comments define what part of the README to add to the index page of the documentation --\u003e\n\u003c!--- --8\u003c-- [start:docs] --\u003e\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[![Documentation](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\u0026logo=medium\u0026logoColor=white)](https://medium.com/arupcitymodelling/pandemic-activity-modifier-intro-3d2dccbc716e)\n[![JOSS DOI](https://img.shields.io/badge/JOSS-10.21105/joss.06097-green.svg)](https://doi.org/10.21105/joss.06097)\n[![Test coverage](https://codecov.io/gh/arup-group/pam/branch/main/graph/badge.svg?token=21BGH9M3FZ)](https://codecov.io/gh/arup-group/pam)\n[![PyPI version](https://img.shields.io/pypi/v/cml-pam.svg)](https://pypi.python.org/pypi/cml-pam)\n[![Anaconda.org version](https://img.shields.io/conda/vn/city-modelling-lab/cml-pam.svg?label=conda)](https://anaconda.org/city-modelling-lab/cml-pam)\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\u003c!--- --8\u003c-- [end:docs] --\u003e\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\u003c!--- --8\u003c-- [start:docs-install-user] --\u003e\n``` shell\nmamba create -n pam -c conda-forge -c city-modelling-lab cml-pam\nmamba activate pam\n```\n\u003c!--- --8\u003c-- [end:docs-install-user] --\u003e\n### As a developer\n\u003c!--- --8\u003c-- [start:docs-install-dev] --\u003e\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\u003c!--- --8\u003c-- [end:docs-install-dev] --\u003e\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` \u0026 `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 \u003chttp://localhost:8000/\u003e.\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farup-group%2Fpam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farup-group%2Fpam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farup-group%2Fpam/lists"}