Installation¶
It is recommended to install ETHOS.TSAM within its own environment. If you are not familiar with python environments, please consider reading some external documentation.
Quick Install (Recommended)
The fastest way to install ETHOS.TSAM is using uv:
Alternative Installation Methods
Using pip:
Using conda-forge:
Creating an Isolated Environment
With uv (recommended):
With conda/mamba:
Local Installation for Development¶
Clone the repository:
Using uv (Recommended)
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e ".[develop]"
Using conda
Development Tools¶
ETHOS.TSAM uses modern Python development tools for code quality:
Linting and Formatting with Ruff
Ruff is used for fast linting and formatting:
# Check for issues
ruff check src/ test/
# Auto-fix issues
ruff check src/ test/ --fix
# Format code
ruff format src/ test/
Type Checking with Mypy
Mypy is used for static type checking:
Pre-commit Hooks
Pre-commit hooks automatically run linting and formatting on every commit:
# Install pre-commit
uv pip install pre-commit
# Set up hooks (run once after cloning)
pre-commit install
# Run manually on all files
pre-commit run --all-files
Running Tests
Tests are run using pytest:
# Run all tests
uv run pytest test/
# Run tests with coverage
uv run pytest test/ --cov=tsam
# Run tests in parallel
uv run pytest test/ -n auto
Installation of an Optimization Solver¶
Some clustering algorithms in ETHOS.TSAM are based on Mixed-Integer Linear Programming. An appropriate solver accessible by Pyomo is required.
HiGHS (Default)
HiGHS is installed by default and works well for most use cases.
Commercial Solvers
For better performance on large problems, commercial solvers are recommended if you have access to a license: