Skip to content

tschm/jsharpe

📦 jsharpe

PyPI version License: MIT CI Created with qCradle

🚀 Getting Started

🔧 Set Up Environment

make install

This installs/updates uv, creates your virtual environment and installs dependencies.

📚 Usage

Run this minimal, deterministic example to compute the Probabilistic Sharpe Ratio (PSR) from the package functions.

from jsharpe import probabilistic_sharpe_ratio

sr = 0.036 / 0.079
psr = probabilistic_sharpe_ratio(SR=sr, SR0=0, T=24, gamma3=-2.448, gamma4=10.164)
print(f"{psr:.3f}")
0.987

✅ Configure Pre-commit Hooks

make fmt

Installs hooks to maintain code quality and formatting.

🛠️ Development Commands

make tests   # Run test suite
make marimo  # Start Marimo notebooks

👥 Contributing

  • 🍴 Fork the repository
  • 🌿 Create your feature branch (git checkout -b feature/amazing-feature)
  • 💾 Commit your changes (git commit -m 'Add some amazing feature')
  • 🚢 Push to the branch (git push origin feature/amazing-feature)
  • 🔍 Open a Pull Request

🏗️ Project Structure & Configuration Templates

This project uses standardized configuration files from jebel-quant/rhiza, which provides a consistent development environment across multiple projects.

Synchronized Files

The following files are automatically synchronized from the template repository:

Template Synchronization

The .github/template.yml file controls which files are synchronized from the template repository. To sync with the latest template updates:

make sync

This ensures the project benefits from improvements to the shared configuration without manual updates.

Customization

While most boilerplate files come from the template, the following are project-specific:

  • README.md (this file)
  • pyproject.toml (project dependencies and metadata)
  • ruff.toml (extended but based on template)
  • Source code in src/
  • Project-specific tests (e.g., tests/test_sharpe.py)

Note: The tests/test_rhiza directory contains template-provided tests for validating the boilerplate configuration itself.