Contributing to SPIMquant¶
Thank you for your interest in contributing to SPIMquant! This document provides guidelines for contributing to the project.
Ways to Contribute¶
There are many ways to contribute to SPIMquant:
- Report bugs: Open issues for bugs you encounter
- Suggest features: Propose new features or improvements
- Improve documentation: Help us improve docs and examples
- Submit code: Fix bugs or implement new features
- Share examples: Contribute workflow examples and tutorials
- Help others: Answer questions in discussions
Getting Started¶
Development Setup¶
- Fork the repository on GitHub
- Clone your fork locally:
- Install development environment:
- Create a branch for your changes:
Development Environment¶
The dev environment includes: - Code formatters (black, isort) - Snakemake formatter (snakefmt) - Testing tools (pytest) - Visualization tools (JupyterLab, napari)
Code Standards¶
Python Code Style¶
SPIMquant uses: - black for code formatting - isort for import sorting - snakefmt for Snakemake files
Format your code before committing:
Coding Guidelines¶
- Follow PEP 8: Python code should follow PEP 8 style guide
- Use type hints: Add type hints to function signatures
- Write docstrings: Document functions, classes, and modules
- Keep functions focused: Each function should do one thing well
- Add tests: Include tests for new functionality
- Comment complex code: Explain non-obvious logic
Snakemake Guidelines¶
- Modular rules: Keep rules focused and reusable
- Use bids() function: For BIDS-compliant file paths
- Document rules: Add comments explaining rule purpose
- Parameter access: Use
snakemake.paramsin scripts - Resource specification: Declare memory/thread requirements
Testing¶
Running Tests¶
# Run all tests
pixi run pytest
# Run specific test file
pixi run pytest tests/test_workflow.py
# Run with verbose output
pixi run pytest -v
Writing Tests¶
- Place tests in
tests/directory - Follow existing test patterns
- Test both success and failure cases
- Use fixtures for common setup
Dry Run Testing¶
Always test workflows with dry run:
Making Changes¶
Workflow for Changes¶
- Create an issue: Describe the bug or feature
- Create a branch: Use descriptive branch names
feature/add-new-template-supportfix/registration-memory-leakdocs/improve-installation-guide- Make changes: Follow code standards
- Test changes: Run tests and dry runs
- Commit changes: Use clear commit messages
- Push to fork: Push your branch to GitHub
- Open pull request: Submit PR for review
Commit Messages¶
Write clear, descriptive commit messages:
Add support for custom templates
- Implement custom template loading
- Add configuration options
- Update documentation
- Add tests for custom templates
Closes #123
Format: - First line: Brief summary (50 chars or less) - Blank line - Detailed explanation if needed - Reference related issues
Pull Request Guidelines¶
- Describe changes: Explain what and why
- Link issues: Reference related issues
- Include tests: Add or update tests
- Update docs: Document new features
- Follow template: Use PR template if provided
Documentation¶
Improving Documentation¶
Documentation is in the docs/ directory using MkDocs.
To build and serve locally:
Documentation Style¶
- Clear and concise: Write for diverse audiences
- Use examples: Include code examples
- Add TODOs: Mark incomplete sections with
<!-- TODO: ... --> - Link related pages: Help users navigate
- Test code examples: Ensure examples work
Adding New Documentation¶
- Create new
.mdfiles in appropriatedocs/subdirectory - Add to navigation in
mkdocs.yml - Link from related pages
- Follow existing structure and style
Reporting Issues¶
Bug Reports¶
When reporting bugs, include:
- Clear title: Descriptive summary of the issue
- SPIMquant version: Output of
pixi run spimquant --version - System information: OS, memory, CPU details
- Steps to reproduce: Minimal example to reproduce bug
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Error messages: Full error output and logs
- Additional context: Anything else relevant
Feature Requests¶
When suggesting features:
- Clear description: What feature you'd like
- Use case: Why it would be useful
- Proposed solution: Ideas for implementation
- Alternatives: Other options considered
- Additional context: Examples from other tools
Code Review Process¶
What to Expect¶
- Review time: May take a few days to weeks
- Feedback: Reviewers may request changes
- Discussion: Open dialogue about implementation
- Iteration: May need multiple rounds of review
- Approval: Maintainer approval required to merge
Review Criteria¶
Reviews check for:
- Code quality and style
- Test coverage
- Documentation completeness
- Performance impact
- Breaking changes
- Security considerations
Community Guidelines¶
Code of Conduct¶
Be respectful and inclusive:
- Use welcoming language
- Respect differing viewpoints
- Accept constructive criticism gracefully
- Focus on what's best for the community
- Show empathy toward others
Getting Help¶
- Questions: Use GitHub Discussions
- Bugs: Open GitHub Issues
- Chat:
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.
Recognition¶
Contributors are recognized in: - GitHub contributors list - Release notes - Documentation acknowledgments
Thank You!¶
Your contributions make SPIMquant better for everyone. Thank you for taking the time to contribute!