Skip to content

How to contribute

Jaeyeong Yang edited this page Sep 2, 2019 · 4 revisions

Prerequisites

To contribute hBayesDM, you should prepare several prerequisites as below:

  • Python 3.5 (or above)
  • R 3.5 (or above)
  • Git (https://git-scm.com/)
  • (recommended) RStudio
  • (recommended) Text code editors (e.g., VS code, Atom, Sublime text)

It is recommended to install hBayesDM first to get ready with its dependencies.

Overall Workflow

Overall, the develop workflow can be done with a following procedure:

  1. Clone the Github repository
  2. Create a new branch from develop branch
  3. Implement and add new model
  4. Make a pull request to develop branch of CCS-Lab/hBayesDM repo

1. Clone the Github repository

The first thing to work on hBayesDM is to clone the GitHub repository. Currently, we restrict push access to authorized contributors only. If you're new to the hBayesDM development, you need to fork the repo, by clicking the Fork button at the top-right corner of the hBayesDM GitHub website.

Open terminal (or git bash on Windows) on your machine, and move to the directory location where you want to clone the repo. You can find detailed guides on basic terminal commands for Windows or Linux & Mac.

Run the following command to clone your forked repo:

git clone https://github.com/<your-github-username-here>/hBayesDM.git
#                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^

# For example:
git clone https://github.com/dlemfh/hBayesDM.git
#                            ^^^^^^

Finally, use the cd command to enter into the (cloned) repo directory.

cd hBayesDM

2. Create a new branch from develop branch

Create a new branch for you to work on, inside your forked repository.

The hBayesDM development process follows the Git Flow model by Vincent Driessen ("A successful Git branching model"), as do many other repositories including stan-dev/stan.

If you don't read anything else, please remember the following when working on new features:

  • Never push directly into develop or master branches.
  • When creating a new branch, branch out from develop and adhere to the naming convention: feature/<some-descriptive-name>. (E.g. feature/add-new-gng-model)

Run the following command to create a new branch:

git checkout -b <name-of-new-branch> <where-to-branch-out-from>
#               ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^

# For example:
git checkout -b feature/add-new-gng-model develop
#               ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^

3. Implement and add new model

See this wiki page for details.

4. Make a pull request

Make a pull request (PR) from the branch you're working on the forked repository, into the develop branch of CCS-Lab/hBayesDM repository. Then, maintainers will review the PR and merge it if it's valid.