Contributing
Contributing to RMS-NAV
Thank you for your interest in contributing to RMS-NAV! This document provides guidelines and instructions for contributing to the project.
Code of Conduct
We expect all contributors to follow our Code of Conduct, which ensures a welcoming and inclusive environment for everyone. See CODE_OF_CONDUCT.md.
Getting Started
Fork the repository on GitHub
Clone your fork locally:
git clone https://github.com/your-username/rms-nav.git cd rms-nav
Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
Set up pre-commit hooks:
pre-commit install
Development Workflow
Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name # or git checkout -b bugfix/issue-number
Make your changes, following our coding standards
Write or update tests as necessary
Run the tests to ensure they pass:
pytest
Commit your changes with a descriptive message:
git commit -m "Add feature: description of your changes"
Push your branch to your fork:
git push origin feature/your-feature-name
Open a Pull Request on GitHub
Coding Standards
We follow these standards for all code contributions:
Python Style: Follow PEP 8
Type Hints: Use type hints for all function parameters and return values
Docstrings: Document all classes and methods with docstrings following the Google style
Testing: Include unit tests for new functionality
Compatibility: Ensure compatibility with Python 3.10+
Example of a well-formatted function:
def calculate_offset(
image: NDArrayFloatType, model: NDArrayFloatType
) -> tuple[float, float]:
"""Calculate the offset between an image and a model.
Parameters:
image: The observed image as a NumPy array
model: The theoretical model as a NumPy array
Returns:
A tuple containing the (u, v) offset in pixels
"""
# Implementation here
return u_offset, v_offset
Pull Request Process
Ensure all tests pass
Update documentation if necessary
Make sure your code is properly formatted and passes both ruff and mypy
Request a review from a maintainer
Address any feedback from reviewers
The maintainers will merge your PR once it meets all requirements.
Testing
We use pytest for testing. To run the tests:
pytest
For more verbose output:
pytest -v
To run a specific test file:
pytest tests/test_specific_file.py
Documentation
We use Sphinx for documentation. To build the docs:
cd docs
make html
The generated documentation will be in docs/_build/html.
When adding new features, please update the relevant documentation:
Update docstrings for new functions and classes
Add examples if appropriate
Update the user guide or developer guide if necessary
Reporting Issues
If you find a bug or have a suggestion for improvement:
Check if the issue already exists in the GitHub issue tracker
If not, create a new issue with:
A clear, descriptive title
A detailed description of the issue
Steps to reproduce (for bugs)
Your environment information (Python version, OS, etc.)
Any relevant logs or screenshots
Thank you for contributing to RMS-NAV!