How to set up your dev environment to work on the grib processor.
First, create a virtual environment like in the [readme](/README.md#setup).
## Goals
Then, install ruff and mypy.
The main goal of this package is to provide a realtime event processor for the SDS that publishes metadata about incoming grib files. As this package is made for the SDS, final say on creative decision goes to the SDS managers.
Before pushing commits run:
The main goal can be accomplished using the `--realtime` CLI option.
`ruff format grib_processor.py`
Additional (secondary) goals include:
`ruff check grib_processor.py`
* Providing different ways to ingest grib files; stdin, specifying one file, etc.
* Providing a python interface to the event processor's components.
* Providing an interface to extract metadata from grib files.
`mypy grib_processor.py`
## Setup
>Note: mypy will give an error about untyped imports, this can be ignored.
Next, install the package from source and create a virtual environment like in the [readme](/README.md#setup).
Then, install the dev dependencies.
```bash
python -m pip install -r requirements_dev.txt
```
Finally, install the package in editable mode.
```bash
python -m pip install -e .
```
### Pre-commit
[pre-commit](https://pre-commit.com/) can be used to automatically format/lint/type check any new commits you make. It is recommended, but not necessary as the CI will also check that for you.
```bash
pre-commit install
pre-commit run --all-files
```
## Testing
When adding a new feature, please add corresponding unit tests under [tests/](/tests/).
Tests can be run using pytest.
```bash
pytest tests/
```
To get the code coverage use the coverage command.