-
Max Drexler authoredMax Drexler authored
Contributing
How to set up your dev environment to work on the grib processor.
Project Scope
There are a lot of things that this package could do, but it's important to have a well-defined scope (this is mostly a reminder for me).
User requirements:
- Watch a directory for new/modified GRIB files.
- Extract specific metadata for each new grid in the GRIB file.
- Publish metadata to RabbitMQ server(s).
Getting the Repo
Clone the repository from SSEC's GitLab instance.
git clone https://gitlab.ssec.wisc.edu/mdrexler/grib_rmq_stream.git
cd grib_rmq_stream
Local Setup
Because of this package's requirement on the C static library libg2c
, the dev setup can be tricky. I've included some straight-forward installation "playbooks", but what is required at the end of the day is an environment with hatch
and libg2c
.
conda
Setup using conda create -n my_env hatch nceplibs-g2c -c conda-forge
conda activate my_env
brew
Setup using brew tap eengl/nceplibs
brew install nceplibs-g2c
brew install hatch
After installation use hatch config set dirs.env.virtual .hatch
, to create the hatch virtual environments in the project's directory (required for type checking).
Linting/Formatting
Linting and formatting is done with the command hatch fmt
. All lints must pass before merging into main.
Testing
Tests are currently a bit sparse, but for the future try to add tests to whatever feature is added.
Tests can be run using hatch test
.
Use hatch test -c
to generate coverage reports.
Open the file htmlcov/index.html
in your browser to see the test coverage visually.
Type Checking
Type checking is done using pyright
, use hatch run types:check
to validate the types.