Contributing to ndastro-engine
Thank you for considering contributing to ndastro-engine! This document outlines the process and guidelines for contributing.
Development Setup
-
Fork and Clone
-
Create Virtual Environment
-
Install Development Dependencies
Development Workflow
Running Tests
Run all tests:
Run with coverage:
Run specific test file:
Code Quality
Linting and Formatting:
Type Checking:
Building Documentation
Build documentation locally:
Serve documentation with live reload:
Then open http://127.0.0.1:8000/ in your browser.
Coding Standards
- Follow PEP 8 style guidelines
- Use type hints for all function parameters and return values
- Write docstrings in Google style format
- Keep functions focused and single-purpose
- Aim for 90%+ test coverage
Example Docstring
def calculate_something(value: float, factor: int = 1) -> float:
"""Calculate something based on value and factor.
Args:
value: The input value to process.
factor: Multiplication factor. Defaults to 1.
Returns:
The calculated result.
Raises:
ValueError: If value is negative.
Example:
>>> calculate_something(10.0, 2)
20.0
"""
if value < 0:
raise ValueError("Value must be non-negative")
return value * factor
Pull Request Process
-
Create a Branch
-
Make Changes
- Write code
- Add/update tests
-
Update documentation if needed
-
Commit
Use conventional commit messages:
- feat: for new features
- fix: for bug fixes
- docs: for documentation changes
- test: for test additions/changes
- refactor: for code refactoring
-
Push and Create PR
-
PR Checklist
- [ ] Tests pass locally
- [ ] Code is formatted with ruff
- [ ] Type checking passes
- [ ] Documentation is updated
- [ ] CHANGELOG.md is updated
- [ ] Descriptive PR title and description
Reporting Issues
When reporting issues, please include:
- Python version
- Operating system
- ndastro-engine version
- Minimal code example reproducing the issue
- Expected vs actual behavior
- Full error traceback if applicable
Feature Requests
Feature requests are welcome! Please:
- Check existing issues first
- Provide clear use case
- Explain expected behavior
- Consider implementation complexity
Code of Conduct
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Assume good intentions
Questions?
Feel free to open an issue for questions or reach out to the maintainers.
License
By contributing, you agree that your contributions will be licensed under the MIT License.