Installation
Requirements
- Python 3.11 or later
- NumPy >= 1.24.0
- pandas >= 2.0.0
Optional dependencies:
rich: For pretty-printing results
Install from PyPI
Once released, install rthor using pip:
Or with uv:
To use our pretty-printing functionality (rthor.print_results) you also need the optional rich dependency:
Install from Source
For the latest development version:
Or with uv:
Development Installation
To contribute to rthor, install with development dependencies:
This installs additional tools for:
- Testing (pytest, pytest-cov)
- Documentation (mkdocs, marimo)
- Linting (ruff, ty)
- Building (build, twine)
- Pre-commit hooks (prek)
Set up pre-commit hooks
This configures hooks for:
- Code formatting (ruff)
- Type checking (ty)
- TOML sorting
- Markdown linting
- Trailing whitespace removal
Verify Installation
import rthor
print(rthor.__version__)
# Run a quick test
import numpy as np
matrix = np.array(
[
[1.00, 0.90, 0.60, 0.30, 0.60, 0.90], # Var 1
[0.90, 1.00, 0.90, 0.60, 0.30, 0.60], # Var 2
[0.60, 0.90, 1.00, 0.90, 0.60, 0.30], # Var 3
[0.30, 0.60, 0.90, 1.00, 0.90, 0.60], # Var 4
[0.60, 0.30, 0.60, 0.90, 1.00, 0.90], # Var 5
[0.90, 0.60, 0.30, 0.60, 0.90, 1.00], # Var 6
]
)
result = rthor.test(matrix, order="circular6")
rthor.print_results(result)
RTHOR Test Results
1 matrix • 6 variables • 72 predictions • 720 permutations
╭──────────────┬────┬───────┬────────────────┬──────────────┬──────────────┬───────────╮
│ Matrix │ │ CI │ Interpretation │ Significance │ Satisfied │ Violated │
├──────────────┼────┼───────┼────────────────┼──────────────┼──────────────┼───────────┤
│ [1] Matrix 1 │ ✓ │ 1.000 │ Excellent fit │ p<.05 * │ 72/72 (100%) │ 0/72 (0%) │
╰──────────────┴────┴───────┴────────────────┴──────────────┴──────────────┴───────────╯
ℹ️ Higher CI values indicate better fit (range: -1 to +1)
Next Steps
- Core Concepts - Understand RTHOR
- Basic Usage - Get started with examples
- API Reference - Full function documentation