entropice/CONTRIBUTING.md

96 lines
2.5 KiB
Markdown
Raw Normal View History

2025-12-28 20:11:11 +01:00
# Contributing to Entropice
Thank you for your interest in contributing to Entropice! This document provides guidelines for contributing to the project.
## Getting Started
### Prerequisites
- CUDA 12 compatible GPU (for full functionality)
- [Pixi package manager](https://pixi.sh/)
### Setup
```bash
pixi install
```
This will set up the complete environment including Python, RAPIDS, PyTorch, and all geospatial dependencies.
2025-12-28 20:11:11 +01:00
## Development Workflow
> Read in the [Architecture Guide](ARCHITECTURE.md) about the code organisatoin and key modules
2025-12-28 20:48:49 +01:00
**Important**: Always use `pixi run` to execute Python commands and scripts to ensure you're using the correct environment with all dependencies:
2025-12-28 20:11:11 +01:00
```bash
pixi run python script.py
pixi run python -c "import entropice"
```
2025-12-28 20:11:11 +01:00
### Python Style and Formatting
2025-12-28 20:11:11 +01:00
- Follow PEP 8 conventions
- Use type hints for function signatures
- Prefer google-style docstrings for public functions
2025-12-28 20:11:11 +01:00
- Keep functions focused and modular
`ty` and `ruff` are used for typing, linting and formatting.
Ensure to check for any warnings from both of these:
2025-12-28 20:11:11 +01:00
```sh
pixi run ty check # For type checks
pixi run ruff check # For linting
pixi run ruff format # For formatting
```
2025-12-28 20:11:11 +01:00
Single files can be specified by just adding them to the command, e.g. `pixi run ty check src/entropice/dashboard/app.py`
2025-12-28 20:11:11 +01:00
## Testing
Run tests for specific modules:
```bash
pixi run pytest
```
When adding features, include tests that verify:
- Correct handling of geospatial coordinates and projections
- Proper aggregation to grid cells
- Data integrity through pipeline stages
## Submitting Changes
### Pull Request Process
1. **Branch**: Create a feature branch from `main`
2. **Commit**: Write clear, descriptive commit messages
3. **Test**: Verify your changes don't break existing functionality
4. **Document**: Update relevant docstrings and documentation
5. **PR**: Submit a pull request with a clear description of changes
### Commit Messages
- Use present tense: "Add feature" not "Added feature"
- Keep first line under 72 characters
### Notebooks
- Notebooks in `notebooks/` are for exploration and validation, they are not commited to git
- Keep production code in `src/entropice/`
## Dashboard Development
Run the dashboard locally:
```bash
pixi run dashboard
```
Dashboard code is in `src/entropice/dashboard/` with modular pages and plotting utilities.
## Questions?
For questions about the architecture, see `ARCHITECTURE.md`. For scientific background, see `README.md`.