Skip to content

Contributing

We welcome contributions to this project.

Guide on development

Clone the repository

    $ git clone https://gitlab.opencode.de/bkg/gravitools.git
    $ cd gravitools/

Create a virtual environment and install in editable-mode, including the optional dependencies for running tests and building the documentation.

    $ python -m venv venv
    $ source venv/bin/activate
    $ pip install -e .[test,docs]

Run tests

Perform dedicated test routines and doctests (example code in docstrings).

    $ pytest

Build the documentation

Convert jupyter notebooks to markdown

    $ jupyter nbconvert --to markdown --execute docs/aqg_1_raw.ipynb --output-dir docs/
    $ jupyter nbconvert --to markdown --execute docs/aqg_2_nc.ipynb --output-dir docs/
    $ jupyter nbconvert --to markdown --execute docs/aqg_cmd.ipynb --output-dir docs/
    $ jupyter nbconvert --to markdown --execute docs/aqg_tilt_calib.ipynb --output-dir docs/
    $ jupyter nbconvert --to markdown --execute docs/aqg_coriolis_calib.ipynb --output-dir docs/

Serve the documentation locally for development

    $ zensical serve

Build the documentation for deployment

    $ zensical build --clean

The HTML files should be in the public/ directory.

Code quality

  • Consider adding a test for new errors. This helps to avoid regression in future commits.
  • Please follow PEP 8 naming conventions and format your code with black and isort.
  • Write docstrings in Google style.