Contributing to FIRM3D
We welcome contributions to FIRM3D! This document provides guidelines for contributing to the project.
Quick Start
Set up development environment:
pip install -e ".[dev]" pre-commit install
Run tests and checks:
ruff check --fix . ruff format . python -m unittest discover tests/ cd docs && make html
Code Style
We use ruff for automated code formatting and linting.
Key Commands:
ruff check .- Check for style issuesruff check --fix .- Auto-fix issuesruff format .- Format code
Configuration:
The project includes a pyproject.toml file with ruff configuration that excludes thirdparty/ directories and ignores physics-specific conventions (E731, E741, E722).
Pre-commit Hooks:
Install with pre-commit install to automatically run code quality checks before each commit.
Note: Ruff linting checks are configured as informational only and will not block commits. This allows you to commit your work while still having access to linting feedback. You can address linting issues at your convenience.
Development Workflow
Create a feature branch or fork for your changes
Make your changes following the style guidelines
Test locally before pushing:
ruff check --fix . ruff format . python -m unittest discover tests/ cd docs && make html
Commit your changes: Pre-commit hooks will run automatically but won’t block commits
Optional: Address linting issues when convenient:
# Check for linting issues ruff check . # Auto-fix what can be fixed ruff check --fix . # Format code ruff format .
Push and monitor CI: Check GitHub Actions for automated tests
Submit a pull request