Skip to main content

Framework for simulating sociotechnical systems.

Project description

Picture of T-Rex next to letters T-RECS

A library for using agent-based modeling to perform simulation studies of sociotechnical systems.

Installation

System requirements

Currently, the simulator has only been tested extensively on MacOS 10.15 and Ubuntu 20.04. This simulator supports Python 3.7+ and it has not been tested with older versions of Python 3. If you have not configured a Python environment locally, please follow Scipy’s instructions for installing a scientific Python distribution.

If you do not have Python 3.7+ installed, you can create a new environment with Python 3.7 by running the following command in terminal:

conda create --name py37 python=3.7

To ensure the example Jupyter notebooks run in your Python 3.7 environment, follow the instructions from this blog post. Note: you will also need pandas to run the example notebooks. As of December 2020, we recommend installing pandas v1.0.5 using the command: pip install 'pandas==1.0.5'. This will help avoid package conflicts between pandas and pylint if you also plan on contributing to trecs and running tests.

For users

To install the simulator, you will need the Python package manager, pip. After activating your virtual environment, run the following command in a terminal:

pip install trecs

For developers

If you’d like to install the latest version of trecs based on what is currently in the main branch of the repository, run the following commands after activating your virtual environment:

git clone https://github.com/elucherini/t-recs.git
cd t-recs
pip install -e .

Additionally, you may run pip install -r requirements-dev.txt to install a few additional dependencies that will be useful for linting, testing, etc.

Documentation

If you would like to edit the documentation, see the docs/ folder. To build the documentation on your local folder, you will need to install sphinx and the sphinx-rtd-theme via pip. Next, cd into the docs folder and run make html. The output of the command should tell you where the compiled HTML documentation is located.

Tutorials

Examples of how to use the simulator can be found in the notebooks below:

  • Quick start: start here for a brief introduction.

  • Complete guide: an overview of the main concepts of the system.

  • Advanced guide - building a model: an introduction to adding your own models on top of the system.

  • Advanced guide - adding metrics: an example of how to add new metrics to a model.

Please check the examples directory for more notebooks.

Example usage

import trecs

recsys = trecs.models.ContentFiltering()
recsys.run(timesteps=10)
measurements = recsys.get_measurements()

Documentation

A first draft of the documentation is available here. In its current version, the documentation can be used as a supplement to exploring details in the code. Currently, the tutorials in examples might be a more useful and centralized resource to learn how to use the system.

Contributing

Thanks for your interest in contributing! Check out the guidelines for contributors in CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trecs-0.2.1.tar.gz (48.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trecs-0.2.1-py3-none-any.whl (113.9 kB view details)

Uploaded Python 3

File details

Details for the file trecs-0.2.1.tar.gz.

File metadata

  • Download URL: trecs-0.2.1.tar.gz
  • Upload date:
  • Size: 48.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.9

File hashes

Hashes for trecs-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9a959fe9f73c387a275a6eeb6270f239f8c2fa6f1bf38ea85e144fa438a77902
MD5 5a28f08f401b2eb4c1fc3ba5aa0b0594
BLAKE2b-256 c82f615e609e5b710e082fe31fed0e007317a006ef127f63affbb0435299cdd9

See more details on using hashes here.

File details

Details for the file trecs-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: trecs-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 113.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.9

File hashes

Hashes for trecs-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b0c6c4076f39a0f5dff552d1acbc772e9e5007e6f51460d42866a4cff87b943
MD5 4a8b984277f505653fe4c0c4eefe4fd9
BLAKE2b-256 c1c9d71e91758c17803154ebc6bed835aa22d51910968e2162e1f0a93900c4a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page