Skip to content

Latest commit

 

History

History
136 lines (94 loc) · 8.09 KB

README.md

File metadata and controls

136 lines (94 loc) · 8.09 KB

Beta-recsys community resources

Community meeting

  • Meeting time: Saturday (1:30 – 2:30pm UTC +0/9:30 – 10:30pm UTC +8), (start from 7 November 2020)
    Add Event

  • Meeting minutes: notes

  • Meeting recordings: [recording links]: Can be found in each meeting note (since Nov.7, 2020).

Discussion channels

  • Slack: Slack Status
  • Mailing list: TBC

Version release

  • Version x.x.n update frequency: Four weeks
  • Version x.n.x update frequency: Eight weeks
  • Version n.x.x update frequency: TBC

Contribution guidelines

Did you write a patch that fixes a bug?

Open a new GitHub pull request with the patch.

Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.

Do you intend to add a new feature or change an existing one?

Suggest your change in the Beta-recsys mailing list or slack, where you can collect feedbacks about the change. Then open an issue on GitHub, assign it to youself or related members, and start writing code.

Before submitting, please read the Contributing to Beta-recsys guide to know more about coding conventions and benchmarks.

Code of Conduct

We use the automatic style formatter Black. See the installation guide for VSCode and PyCharm. Black supersets the well-known style guide PEP 8, defined by Guido van Rossum and collaborators. PEP 8 defines everything from naming conventions, indentation guidelines, block vs inline comments, how to use trailing commas and so on.

We use Google style for formatting the docstrings.

Black formatting on Python files. Black formatting on Notebooks. Docstring with Google style. Isort to sort imports alphabetically, and automatically separated into sections. If you are using Pycharm, it will be convenient to deploy black and isort commands as External Tools.

**Use the following args to make it compatible with black. **

isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=88 [ file.py ] Or directly apply the default config file in our project root folder.

[settings]
line_length=88
indent='    '
multi_line_output=3
include_trailing_comma=true
use_parentheses=true
force_grid_wrap=0

The following examples are part of demo.py. For complete usages, please refer to demo.py.

Git Setup

Configure remotes

When a repository is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repository it was forked from. To keep track of the original repository, you should add another remote named upstream:

  1. Get the path where you have your git repository on your machine. Go to that path in Terminal using cd. Alternatively, Right click on project in Github Desktop and hit ‘Open in Terminal’.
  2. Run git remote -v to check the status you should see something like the following:

origin https://github.com/YOUR_USERNAME/beta-recsys.git (fetch)
origin https://github.com/YOUR_USERNAME/beta-recsys.git (push)

  1. Set the upstream:
    git remote add upstream https://github.com/beta-team/beta-recsys.git
  2. Run git remote -v again to check the status, you should see something like the following:

origin https://github.com/YOUR_USERNAME/beta-recsys.git (fetch)
origin https://github.com/YOUR_USERNAME/beta-recsys.git (push)
upstream https://github.com/beta-team/beta-recsys.git (fetch)
upstream https://github.com/beta-team/beta-recsys.git (push)

  1. To update your local copy with remote changes, run the following:
    git fetch upstream master
    git rebase upstream/master
    This will give you an exact copy of the current remote, make sure you don't have any local changes.
  2. Project set-up is complete.

Contributing and developing a feature

  1. Make sure you are in the develop branch git checkout develop.
  2. Sync your copy with the upstream.
  3. Create a new branch with a meaningful name git checkout -b branch_name.
  4. Add the files you changed git add file_name (avoid using git add .).
  5. Commit your changes git commit -m "feat: Message briefly explaining the feature".
  6. Keep one commit per issue. If you forgot to add changes, you can edit the previous commit git commit --amend.
  7. Push to your repo git push origin branch-name.
  8. Go into the Github repo and create a pull request explaining your changes.
  9. If you are requested to make changes, edit your commit using git commit --amend, push again and the pull request will edit automatically.
  10. If you have more than one commit try squashing them into single commit by following command:
    git rebase -i origin/master~n master(having n number of commits).
  11. Once you've run a git rebase -i command, text editor will open with a file that lists all the commits in current branch, and in front of each commit is the word "pick". For every line except the first, replace the word "pick" with the word "squash".
  12. Save and close the file, and a moment later a new file should pop up in editor, combining all the commit messages of all the commits. Reword this commit message into meaningful one briefly explaining all the features, and then save and close that file as well. This commit message will be the commit message for the one, big commit that you are squashing all of your larger commits into. Once you've saved and closed that file, your commits of current branch have been squashed together.
  13. Force push to update your pull request with command git push origin branchname --force.

Commit guidelines

  • Make sure that you only have one commit for each PR. To merge commits, please refer to link.

  • The commit message should strictly be start with the following six strings, otherwise, the PR cannot be passed by our CI.

    • String Issue
      "feat:[[:space:]].*$" New feature
      "fix:[[:space:]].*$" Fixing a bug
      "test:[[:space:]].*$" Adding test codes
      "chore:[[:space:]].*$" Others chore operation such as rearranging folders or renaming files.
      "Merge pull request.*$" Automatic merge
      "doc:[[:space:]].*$" Improving documentation

Active members (based on Github contributors)