Skip to content

Latest commit

 

History

History
144 lines (101 loc) · 3.75 KB

CONTRIBUTING.md

File metadata and controls

144 lines (101 loc) · 3.75 KB

Contributing to OpenDIVE

Thank you for your interest in contributing to OpenDIVE!

How to contribute

  1. Fork the repository

Navigate to the main repository on GitHub. Click the Fork button in the upper-right corner of the repository page. This will create a copy of the repository under your GitHub account.

  1. Clone the fork

Open a terminal and clone the repository to your machine:

git clone https://github.com/<your-username>/open_dive.git

Change into the cloned repository directory

cd open_dive
  1. Set Up the Upstream Repository

Add the original repository as an upstream remote to keep your fork up-to-date:

git remote add upstream https://github.com/MASILab/open_dive.git

Verify the remotes:

git remote -v
  1. Create a Feature Branch

Make sure you are on the default branch:

git checkout main

Pull the latest changes from the upstream repository:

git pull upstream main
git checkout -b <your-feature-branch-name>
  1. Make Changes and Commit

Make your changes to the codebase. Add the changes to the staging area:

git add .

Commit your changes with a descriptive message:

git commit -m "added my changes"
  1. Push Your Changes

Push your changes to your forked repository:

git push origin <your-feature-branch-name>
  1. Open a Pull Request

Go to your forked repository on GitHub. You should see a notification that your recently pushed branch has changes. Click the Compare & pull request button.

Fill out the pull request form with a clear title and description of your changes. Select the target branch in the original repository (main). Submit the pull request by clicking the Create pull request button.

  1. Respond to Feedback

Be ready to respond to any comments or requested changes from the maintainers. Make additional commits to your branch to address feedback, and push them to your fork. The pull request will update automatically.

For future contributions, you can repeat the instructions from step 4.

Installing OpenDIVE

It is highly recommended that you work within a virtual environment to isolate your packages from other Python installations on your system.

Using uv (recommended)

We recommend installing Python via uv. See instructions here. This will allow you to create a virtual environment that ensures we are all working with the same package versions.

Once you have uv installed and have a local clone of the repository, you can create the virtual environment by running the following command:

uv sync 
uv pip install -e </path/to/open_dive>

Then, you can run code using the uv command:

uv run <file>

Alternatively, if you would rather use the python command, you can activate the virtual environment after syncing from within the open_dive/ folder:

source .venv/bin/activate
python <file>

Using conda or mamba

If you already are using conda or mamba on your machine, you can set up a virtual environment for open-dive:

conda create -n open-dive python=3.12
conda activate open-dive
pip install -e </path/to/open_dive>

Congrats!! If you've made it this far, you're ready to start hacking! Head to Issue #1 to get started!

Coding guidelines

We ask that all code is well-commented. Please add numpydoc-style docstrings to document your functions and classes. For example, if you create code to add two numbers:

def add(a, b):
    """
    Add together two numbers.

    Parameters
    ----------
    a : int
        First number to add.
    b : int
        Second number to add.
    
    Returns
    -------
    sum : int
        The sum of the two numbers.
    """
    sum = a + b
    return sum