Thank you for your interest in contributing to RTGS Lab Tools! This document provides guidelines and information for contributors.
-
Clone
# Fork the repository on GitHub git clone https://github.com/RTGS-Lab/rtgs-lab-tools.git cd rtgs-lab-tools
-
Install Development Environment
# Use the automated installation script bash install.sh -
Verify Installation
# Run tests to ensure everything is working pytest # Check that the CLI works rtgs --help
Use descriptive branch names that follow these patterns:
-
Feature branches:
feature/short-description- Example:
feature/add-error-visualization - Example:
feature/improve-era5-download
- Example:
-
Bug fixes:
fix/issue-description- Example:
fix/database-connection-timeout - Example:
fix/csv-parsing-error
- Example:
-
Documentation:
docs/description- Example:
docs/update-installation-guide - Example:
docs/add-api-examples
- Example:
-
Refactoring:
refactor/component-name- Example:
refactor/sensing-data-extractor - Example:
refactor/cli-argument-parsing
- Example:
-
Create a Branch
git checkout master git pull origin master git switch -c feature/your-feature-name
-
Make Changes
- Write code following style guidelines
- Add or update tests as needed
- Update documentation if necessary
-
Commit Messages Use clear, descriptive commit messages:
# Good examples: git commit -m "Add support for Parquet export in data extractor" git commit -m "Fix timeout handling in ERA5 download" git commit -m "Update CLI help text for visualization commands" # Avoid: git commit -m "Fix stuff" git commit -m "Update"
-
Keep Branch Updated
git checkout master git pull origin master git checkout feature/your-feature-name git rebase master
We use several tools to maintain code quality:
# Format code with black
black src/ tests/
# Sort imports with isort
isort src/ tests/
# Run all quality checks
black src/ tests/ && isort src/ tests/- Python Style: Follow PEP 8 and use type hints
- Docstrings: Use Google-style docstrings for all public functions
- Variable Names: Use descriptive names (
node_idnotn) - Function Length: Keep functions focused and under 50 lines when possible
- Error Handling: Use specific exception types and meaningful error messages
- Write Tests: All new features should include tests
- Test Coverage: Aim for high test coverage on new code
- Test Types:
- Unit tests for individual functions
- Integration tests for database operations
- CLI tests for command-line interface
# Run all tests
pytest
# Run tests with coverage
pytest --cov=src/rtgs_lab_tools
# Run specific test file
pytest tests/sensing_data/test_data_extractor.py- Code follows style guidelines (black, isort, mypy pass)
- All tests pass locally
- New features include tests
- Documentation is updated if needed
- Commit messages are clear and descriptive
Use clear, descriptive titles:
Add support for multi-node error analysis visualization
Fix database connection pooling in data extractor
Update installation documentation for Windows users
Refactor CLI argument parsing for better maintainability
Use this template for your pull request description:
## Summary
Brief description of what this PR does and why.
## Changes Made
- Bullet point list of specific changes
- Include any breaking changes
- Mention new dependencies if any
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests pass
- [ ] Manual testing performed
- [ ] CLI commands tested
## Documentation
- [ ] README updated if needed
- [ ] Docstrings added/updated
- [ ] Examples provided if applicable
## Related Issues
Closes #123 (if applicable)
Related to #456 (if applicable)
## Screenshots/Examples
Include any relevant screenshots or example output if applicable.- Automated Checks: GitHub Actions will run tests and quality checks
- Code Review: Maintainers will review your code
- Address Feedback: Make requested changes
- Approval: Once approved, your PR will be merged
- Check Existing Issues: Look for related issues or discussions
- Design Discussion: For large features, open an issue to discuss the design
- Start Small: Break large features into smaller, reviewable pieces
- Documentation: Update relevant documentation
When adding new functionality, follow the existing module structure:
src/rtgs_lab_tools/
├── new_module/
│ ├── __init__.py
│ ├── cli.py # CLI commands
│ ├── core_functionality.py # Main logic
│ └── processors.py # Data processing (if needed)
└── tests/
└── new_module/
├── test_cli.py
└── test_core_functionality.py
If your changes affect database operations:
- Test with actual database connections
- Consider connection pooling and timeouts
- Handle network errors gracefully
- Update database documentation
For command-line interface changes:
- Follow existing argument patterns
- Add helpful help text
- Include examples in docstrings
- Test with various input combinations
We follow semantic versioning (SemVer):
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
For maintainers releasing new versions:
- All tests pass
- Documentation is updated
- Version number bumped in
pyproject.toml - CHANGELOG updated
- Git tag created
- PyPI package published
- GitHub Issues: For bug reports and feature requests
- GitHub Discussions: For questions and general discussion
- Email: Contact Bryan Runck (runck014@umn.edu) for database access
# Add a new CLI command
# 1. Add command to appropriate cli.py file
# 2. Add tests
# 3. Update documentation
# Add a new data processor
# 1. Create in appropriate module
# 2. Add to __init__.py exports
# 3. Add tests and documentation
# Update dependencies
# 1. Update pyproject.toml
# 2. Test with new versions
# 3. Update requirements if needed- Import Errors: Ensure you're in the virtual environment and package is installed in editable mode
- Test Failures: Check if you have required credentials in
.envfile - Database Connection: Ensure UMN VPN is connected for database tests
- Type Errors: Run
mypy src/to check for type issues
If you're stuck:
- Check existing issues and discussions
- Look at similar code in the codebase
- Run tests to see what's expected
- Open a draft PR to get early feedback
Contributors will be recognized in:
- Git commit history
- Release notes for significant contributions
- README acknowledgments for major features
Thank you for contributing to RTGS Lab Tools!