Thank you for your interest in contributing to pyFIA! This document provides guidelines for contributing to the project.
By participating in this project, you agree to maintain a respectful and inclusive environment. We expect all contributors to:
- Be respectful and constructive in discussions
- Welcome newcomers and help them get started
- Focus on what is best for the community and the project
-
Clone the repository
git clone https://github.com/mihiarc/pyfia.git cd pyfia -
Create a virtual environment with uv
uv venv source .venv/bin/activate # Linux/macOS # or .venv\Scripts\activate on Windows
-
Install in development mode
uv pip install -e .[dev]
-
Verify installation
uv run pytest tests/unit -v
# Run all tests
uv run pytest
# Run unit tests only (fast)
uv run pytest tests/unit
# Run with coverage
uv run pytest --cov=pyfia
# Run specific test markers
uv run pytest -m "not slow" # Skip slow tests
uv run pytest -m "not network" # Skip network-dependent testsWe use ruff for linting/formatting and mypy for type checking:
# Format code
uv run ruff format src/pyfia tests
# Lint and auto-fix
uv run ruff check --fix src/pyfia tests
# Type checking
uv run mypy src/pyfiaBefore opening an issue, please:
- Search existing issues to avoid duplicates
- Use the issue templates if available
- Provide context:
- pyFIA version (
pip show pyfia) - Python version
- Operating system
- Minimal reproducible example
- Expected vs actual behavior
- pyFIA version (
- Open an issue first to discuss significant changes
- Fork the repository and create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes following the code style guidelines below
- Add tests for new functionality
- Run the test suite to ensure nothing is broken
- Update documentation if needed
- Submit a pull request with a clear description
- Simplicity first: Avoid over-engineering. Direct functions over complex abstractions.
- Descriptive names: Use clear, descriptive variable and function names
- Type hints: Add type annotations to public functions
- Docstrings: Follow NumPy docstring format for public APIs
- Testing: Write tests for new functionality using real FIA data where possible
pyFIA implements design-based estimation following Bechtold & Patterson (2005). When modifying estimation code:
- Validate against EVALIDator: Use the built-in validation tools
- Document methodology: Reference specific equations from the literature
- Preserve accuracy: Never sacrifice statistical correctness for convenience
- Statistical validity - Results must match EVALIDator
- User value - Features should reduce friction for end users
- Simplicity - When in doubt, choose the simpler approach
- Performance - Choose fast implementations over elegant abstractions
- Open a GitHub Discussion for questions
- Open an Issue for bugs or feature requests
By contributing, you agree that your contributions will be licensed under the MIT License.