Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

stanmart/unstructured-bargaining-experiment

Repository files navigation

Website Checks oTree License: MIT

unstructured-bargaining-experiment

An otree experiment for testing unstructured bargaining in a specific context.

Installation

pixi (recommended)

The recommended way to install the project is using pixi, which manages both conda and pip dependencies across all platforms.

Install pixi following the installation instructions, then simply run:

pixi install

That's it! All dependencies will be installed automatically.

uv

Alternatively, you can use uv for a fast Python package manager.

Create the environment with Python 3.12:

    uv venv --python 3.12

Activate the environment:

    source .venv/bin/activate  # Linux/Mac
    .venv/Scripts/activate  # Windows

Then install the requirements:

    uv pip install -r requirements.txt

pre-commit

To set up pre-commit hooks for code quality checks:

pixi run pre-commit-install

This will run linting and formatting checks automatically on every commit.

Without pixi

You'll need to install pre-commit manually (e.g., with pip or your package manager) and then run:

pre-commit install

Running a development server

Open a terminal in the project folder and run:

pixi run dev
Without pixi
otree devserver

Then navigate to http://localhost:8000 in your browser. You can stop the server by pressing Ctrl+c in your terminal window.

Prod deployment

The Procfile is set up to start a production server on Heroku. Simply create an app, assign a dyno and a Postgres database, and deploy the app from this repo.

Testing and code quality

The project has a number of tests and code quality checks. Please make sure that all checks pass before merging to the main branch.

Running tests locally:

pixi run test  # Run oTree tests with bots

Running linting and type checks locally:

pixi run lint  # Run all linting checks (ruff, codespell, pyright)
Without pixi

Make sure that pre-commit and pyright are installed and available in your PATH.

Then run:

otree test  # Run oTree tests
pre-commit run --all-files  # Run ruff and codespell
pyright  # Run type checking

Continuous Integration (CI)

The project is set up with GitHub Actions to run these checks automatically on every push and pull request to the main branch.

Checks performed by CI
  • otree test for playing the experiment with automated bots
  • pyright for Python type checking
  • ruff check for Python code style
  • ruff format for Python code formatting
  • codespell for spell checking

About

An otree experiment for testing unstructured bargaining between one indispensable and two other players. Pre-registration: https://www.socialscienceregistry.org/trials/13593

Resources

License

Stars

Watchers

Forks

Contributors