Git Workflow¶
If you are not familiar with git
, please refer to a tutorial such as this one.
In COMPAS
we work in the dev
branch, and use the master
branch for the major version changes. The main workflow is as follows:
Create a git-issue describing the tasks you want to work on (this is optional, but recommended).
Create a new branch from
dev
with a descriptive name (e.g.feature/issue-123
), and make a draft pull request todev
. This will allow you to work on the code collaboratively and get feedback from the team.Make your changes, commit them, and push them to the remote repository. Every commit will trigger the continuous integration (CI) tests.
Once you are happy with your changes, check that CI tests are passing, and switch the PR to
ready for review
. This will make it clear to the team that your changes are ready for review.
The team will review your changes, and may ask you to make some modifications. You can make these changes in the same branch, and push them to the remote repository. Once the changes are approved, the PR will be merged into dev
.
CI Tests¶
There are a few tests that are run automatically when you push your changes to the remote repository. These tests are:
spell-checking This ensures that docstrings and comments are correctly spelled.
COMPAS compile test This ensures that COMPAS C++ and python utilities can be correctly compiled (and COMPAS can run on a fiducial binary system).
COMPAS py-utils unit tests This ensures that some of the python utilities are working as expected.
The tests will fail if the fiducial binary system does not lead to a binary black hole merger.
1#bin/bash
2echo ">>> GENERATING TEST COMPAS DATA <<<"
3# if $COMPAS_EXECUTABLE_PATH not set, set to ../../src/COMPAS
4COMPAS_EXECUTABLE_PATH=${COMPAS_EXECUTABLE_PATH:-../../src/COMPAS}
5$COMPAS_EXECUTABLE_PATH \
6 -n 2 \
7 --initial-mass-1 35 \
8 --initial-mass-2 31 \
9 -a 3.5 \
10 --random-seed 0 \
11 --metallicity 0.001 \
12 --detailed-output \
13 > compas_run.log
14cat compas_run.log
15echo "Generating detailed evolution plot"
16compas_plot_detailed_evolution "./COMPAS_Output/Detailed_Output/BSE_Detailed_Output_0.h5" --dont-show >> detailed_evolution.log
17echo "Out files:"
18ls -l
19echo ">>> DONE <<<"