Skip to content

Contributing

Thank you for your interest in contributing to lonpy!

Development Setup

  1. Clone the repository:
git clone https://github.com/agh-a2s/lonpy.git
cd lonpy
  1. Install with development dependencies:
uv sync --all-extras
  1. Install pre-commit hooks:
pre-commit install

Development Workflow

Running Tests

pytest

With coverage:

pytest --cov=lonpy --cov-report=html

Code Quality

Run all pre-commit hooks:

pre-commit run --all-files

Individual tools:

# Linting
ruff check src/

# Formatting
ruff format src/

# Type checking
mypy src/

Building Documentation

Preview locally:

mkdocs serve

Build static site:

mkdocs build

Code Style

  • Follow PEP 8 conventions
  • Use type hints for all public functions
  • Write docstrings in Google style
  • Keep functions focused and small

Pull Request Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and linting
  5. Commit with a clear message
  6. Push to your fork
  7. Open a Pull Request

Commit Messages

Use clear, descriptive commit messages:

feat: add support for custom perturbation functions
fix: correct edge weight calculation in CMLON
docs: update visualization examples
test: add tests for edge cases in sampling

Reporting Issues

When reporting bugs, please include:

  • Python version
  • lonpy version
  • Minimal reproducible example
  • Expected vs actual behavior
  • Full error traceback

Feature Requests

Feature requests are welcome! Please:

  • Check existing issues first
  • Describe the use case
  • Explain why it would be useful

Questions

For questions about using lonpy: