Package: tomsup
tomsup: Theory of Mind Simulation using PythonA Python Package for Agent-Based simulations. The package provides a computational eco-system for investigating and comparing computational models of hypothesized Theory of mind (ToM) mechanisms and for using them as experimental stimuli. The package notably includes an easy-to-use implementation of the variational Bayesian k-ToM model developed byDevaine, et al. (2017). This model has been shown able to capture individual and group-level differences in social skills, including between clinical populations and across primate species. It has also been deemed among the best computational models of ToM in terms of interaction with others and recursive representation of mental states. We provide a series of tutorials on how to implement the k-ToM model and a score of simpler types of ToM mechanisms in game-theory based simulations and experimental stimuli, including how to specify custom ToM models, and show examples of how resulting data can be analyzed.📰 News7 March 2022Paper accepted atBehavior Research Methods2022v. 1.1.5New plotting features were addedSpeed and memory improvements as well as support for multicore simulations 🏎Added workflows to ensure dependencies are being updatedMinor bugfixesv. 1.1.0Aspeed comparisonbetween the matlab implementation was introduced, showing the the tomsup implementation to be notably faster.An extensive testsuite was introduced, for how to run it see the FAQ.Code coverage was upped to 86% and code quality was raised to A.Adocumentationsite was introduced.Added continiuous integration to ensure that the package always works as intended, with support for mac, windows and linux tests.A new logo was introduced 🌟v. 1.0.0tomsup released its first version along with apreprinton psyarxivA series oftutorialswas introduced to get you started with tomsup🔧 Setup and installationtomsup supports Python 3.6 or later. We strongly recommend that you install tomsup from pip. If you haven't installed pip you can install it fromthe official pip website, otherwise, run:pipinstalltomsupDetailed instructionsYou can also install it directly from GitHub by simply running:pipinstallgit+https://github.com/KennethEnevoldsen/tomsup.gitor more explicitly:gitclonehttps://github.com/KennethEnevoldsen/tomsup.gitcdtomsup
pip3install-e.Getting Started with tomsupTo get started with tomsup we recommend the tutorials in the tutorialsfolder. We recommend that you start with the introduction.The tutorials are provided as Jupyter Notebooks. If you do not have Jupyter Notebook installed, instructions for installing and running can be foundhere.TutorialContentfile nameOpen withDocumentationThe documentations of tomsupIntroductiona general introduction to the features of tomsup which follows the implementation in the paperpaper_implementation.ipynbCreating an agentan example of how you would create new agent for the package.Creating_an_agent.ipynbSpecifying internal statesa short guide on how to specify internal states on a k-ToM agentspecifying_internal_states.ipynbPsychopy experimentAn example of how one might implement tomsup in an experimentNot a notebook, but a folder, psychopy_experiment🤔 Issues and Usage Q&ATo ask report issues or request features, please use theGitHub Issue Tracker. Otherwise, please use thediscussion Forums.FAQHow do I test the code and run the test suite?tomsup comes with an extensive test suite. In order to run the tests, you'll usually want to clone the repository and build tomsup from the source. This will also install the required development dependencies and test utilities defined in the requirements.txt.pip install -r requirements.txt
pip install pytest

python -m pytestwhich will run all the test in thetomsup/testsfolder.Specific tests can be run using:python -m pytest tomsup/tests/<DesiredTest>.pyCode CoverageIf you want to check code coverage you can run the following:pip install pytest-cov

python -m pytest--cov=.Does tomsup run on X?tomssup is intended to run on all major OS, this includes Windows (latest version), MacOS (Catalina) and the latest version of Linux (Ubuntu). Please note these are only the systems tomsup is being actively tested on, if you run on a similar system (e.g. an earlier version of Linux) the package will likely run there as well.How is the documentation generated?Tomsup usessphinxto generate documentation. It uses theFurotheme with a custom styling.To make the documentation you can run:# install sphinx, themes and extensions
pip install sphinx furo sphinx-copybutton sphinxext-opengraph

# generate html from documentations

make -C docs htmlUsing this WorkLicensetomsup is released under theApache License, Version 2.0.CitingIf you use this work please cite:@article{waade2022introducing,title={Introducing tomsup: Theory of mind simulations using Python},author={Waade, Peter T and Enevoldsen, Kenneth C and Vermillet, Arnault-Quentin and Simonsen, Arndis and Fusaroli, Riccardo},journal={Behavior Research Methods},pages={1--35},year={2022},publisher={Springer}}