Thank you for your interest in contributing to OpenDIVE!
- 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.
- 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
- 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
- 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>
- 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"
- Push Your Changes
Push your changes to your forked repository:
git push origin <your-feature-branch-name>
- 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.
- 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.
It is highly recommended that you work within a virtual environment to isolate your packages from other Python installations on your system.
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>
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!
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