-
Notifications
You must be signed in to change notification settings - Fork 2
Contributing
Roberto Cruz edited this page May 15, 2026
·
2 revisions
Thank you for contributing to TietAI Synthea! This guide covers the workflow for bug fixes, new features, and new disease modules.
# Fork the repo on GitHub, then clone your fork
git clone https://github.com/<your-username>/tietai-synthea.git
cd tietai-synthea
# Set up development environment
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
# Install pre-commit hooks
uv run pre-commit install# Create a feature branch
git checkout -b feat/my-feature
# Make changes, then run tests
uv run pytest
# Check formatting
uv run black --check src/ tests/
uv run flake8 src/
# Type checking
uv run mypy src/
# Auto-format
uv run black src/ tests/- Create a JSON state machine in
resources/modules/my_condition.json - Validate:
uv run python -m synthea.validate_module resources/modules/my_condition.json - Generate a test population:
uv run synthea -p 100 -m my_condition -s 42 - Visualise:
uv run synthea --graphviz my_condition && dot -Tpng my_condition.dot -o my_condition.png - Add a test in
tests/that generates patients and asserts the condition appears in health records
Refer to the Disease Modules page for the full JSON schema reference.
- Tests added / updated and passing (
uv run pytest) - Code formatted (
uv run black src/ tests/) - No new linting errors (
uv run flake8 src/) - Type hints correct (
uv run mypy src/) - Module validated if applicable
- PR description explains the motivation and what changed
Open an issue at GitHub Issues with:
- Synthea version (
uv run synthea --version) - Python version (
python --version) - OS and architecture
- Command or code that reproduces the bug
- Expected vs. actual behaviour
- Debug output if available (
--log-level debug)
Open a GitHub Discussion in the Ideas category before opening a PR for large changes. This avoids duplicate effort and ensures alignment.
- Formatter: Black (line length 100)
- Linter: flake8
- Type hints: required for all public functions
- Docstrings: one-line summary only for simple functions; longer description only when the behaviour is non-obvious
- Comments: only when the why is non-obvious
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.