Developer guide

Developer guide#

Thank you for considering contributing to this project! Here are some guidelines to help you get started:

Installation from source#

This installation guide is intended for developers who wish to contribute to or modify the barotropy source code. It assumes that the developer is using a Linux distribution or Windows with Git Bash terminal to have access to Git and Linux-like commands.

  1. Fork the repository

    Go to the project’s GitHub page and click the “Fork” button in the upper right corner to create your own copy of the repository.

  2. Clone the forked repository

    In your terminal, run:

    git clone https://github.com/<your-username>/barotropy.git
    cd barotropy
    
  3. Create a development environment

    You can choose between two options:

    Option A: Use Poetry directly

    If you already have Poetry installed on your system, run:

    poetry install
    

    Poetry will automatically create a virtual environment and install the required dependencies.

    Option B: Use Conda to manage the environment

    If you prefer Conda for environment management, run:

    conda create --name barotropy_env python=3.13 pip poetry
    conda activate barotropy_env
    poetry install
    

    This sets up a Conda environment and installs Poetry inside it to manage dependencies.

  4. Verify the installation

    Run the following to confirm the package is working:

    poetry run python -c "import barotropy; barotropy.print_package_info()"
    

    If the installation was successful, you will see the barotropy banner and package details printed in the terminal.

  5. Install additional packages

    To add a runtime dependency:

    poetry add <package-name>
    

    To add a development-only dependency (e.g., for testing or docs):

    poetry add --dev <package-name>
    

    This will update both pyproject.toml and poetry.lock accordingly.