Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Development

How to set up a development environment, run tests, and contribute to pylcm.

Setup

pylcm uses pixi for dependency management. Python 3.14+ is required.

# Clone the repository
git clone https://github.com/OpenSourceEconomics/pylcm.git
cd pylcm

The first pixi run command will install dependencies automatically, but you can run pixi install explicitly if you prefer.

Install pre-commit hooks (requires prek):

pixi global install prek
prek install

Running Tests

# All tests
pixi run tests

# Tests with coverage
pixi run tests-with-cov

# Specific test file
pixi run pytest tests/test_specific_module.py

# Specific test function
pixi run pytest tests/test_specific_module.py::test_function_name

Code Quality

# Type checking (ty, not mypy)
pixi run -e tests-cpu ty

# Run all pre-commit hooks
prek run --all-files

Building Documentation

# Build docs
pixi run build-docs

# Live preview (watches for changes)
pixi run view-docs

Conventions

Code Style

Testing

Naming

Plotting

Docstrings

Contributing

Report bugs and suggest features on the GitHub issue tracker.