|
a |
|
b/CONTRIBUTING.md |
|
|
1 |
# Contributing to pymskt |
|
|
2 |
|
|
|
3 |
Thank you for considering to contribute to `pymskt`. |
|
|
4 |
|
|
|
5 |
This guide is inspired by [DOSMA](https://github.com/ad13/DOSMA). |
|
|
6 |
|
|
|
7 |
## How to contribute |
|
|
8 |
There are many ways to contribute: |
|
|
9 |
|
|
|
10 |
* Issues: Submitting bugs or suggesting new features |
|
|
11 |
* Documentation: Adding to the documentation or to the examples |
|
|
12 |
* Features: Implementing new features or bug fixes |
|
|
13 |
* Community: Answering questions and helping others get started |
|
|
14 |
|
|
|
15 |
## Submitting a new issue or feature request |
|
|
16 |
Please do your best to follow these guidelines when opening an issue. It will make it signficantly easier to give useful feedback and resolve the issue faster. |
|
|
17 |
|
|
|
18 |
### Found a bug? |
|
|
19 |
We would very much appreciate if you could **make sure the bug was not already reported** (use the search bar on Github under Issues). If you cannot find you bug, follow the instructions in the [Bug Report](https://github.com/gattia/pymskt/issues/new/choose) template. |
|
|
20 |
|
|
|
21 |
### Want a new feature ? |
|
|
22 |
|
|
|
23 |
A world-class feature request addresses the following points: |
|
|
24 |
|
|
|
25 |
1. Motivation first: |
|
|
26 |
* Is it related to a problem/frustration with the library? If so, please explain why. Providing a code snippet that demonstrates the problem is best. |
|
|
27 |
* Is it related to something you would need for a project? We'd love to hear about it! |
|
|
28 |
* Is it something you worked on and think could benefit the community? Awesome! Tell us what problem it solved for you. |
|
|
29 |
2. Write a full paragraph describing the feature; |
|
|
30 |
3. Provide a code snippet that demonstrates its future use; |
|
|
31 |
4. In case this is related to a paper, please attach a link; |
|
|
32 |
5. Attach any additional information (drawings, screenshots, etc.) you think may help. |
|
|
33 |
|
|
|
34 |
If your issue is well written we're already 80% of the way there by the time you post it. Follow the instructions in the [Feature Request](https://github.com/gattia/pymskt/issues/new/choose) |
|
|
35 |
|
|
|
36 |
## Contributing |
|
|
37 |
Before writing code, we strongly advise you to search through the existing PRs or issues to make sure that nobody is already working on the same thing. If you are unsure, it is always a good idea to open an issue to get some feedback. |
|
|
38 |
|
|
|
39 |
You will need basic git proficiency to be able to contribute to pymskt. git is not the easiest tool to use but it has the greatest manual. Type git --help in a shell and enjoy. If you prefer books, [Pro Git](https://git-scm.com/book/en/v2) is a very good reference. |
|
|
40 |
|
|
|
41 |
Follow these steps to start contributing: |
|
|
42 |
|
|
|
43 |
1. Fork the [`repository`](https://github.com/gattia/pymskt) by clicking on the 'Fork' button the repository's page. This creates a copy of the code under your GitHub user account. |
|
|
44 |
|
|
|
45 |
2. Clone your fork to your local disk, and add the base repository as a remote: |
|
|
46 |
|
|
|
47 |
```bash |
|
|
48 |
$ git clone git@github.com:<your Github handle>/pymskt.git |
|
|
49 |
$ cd pymskt |
|
|
50 |
$ git remote add upstream https://github.com/gattia/pymskt.git |
|
|
51 |
``` |
|
|
52 |
|
|
|
53 |
3. Create a development branch - all changes should merged with the `pymskt`-`development` branch: |
|
|
54 |
|
|
|
55 |
```bash |
|
|
56 |
$ git checkout -b development |
|
|
57 |
``` |
|
|
58 |
|
|
|
59 |
**Do not** work on the `main` branch. |
|
|
60 |
|
|
|
61 |
|
|
|
62 |
You can also work on another branch that is named specifically for your problem e.g., |
|
|
63 |
|
|
|
64 |
```bash |
|
|
65 |
$ git checkout -b fix_examples |
|
|
66 |
``` |
|
|
67 |
|
|
|
68 |
Once you are done with making changes, you can `add` and `commit` them: |
|
|
69 |
|
|
|
70 |
```bash |
|
|
71 |
$ git add . # the . means all files are added |
|
|
72 |
$ git commit |
|
|
73 |
``` |
|
|
74 |
|
|
|
75 |
and then merge with development before pushing development to your repository: |
|
|
76 |
|
|
|
77 |
```bash |
|
|
78 |
$ git checkout development |
|
|
79 |
$ git merge fix_examples |
|
|
80 |
``` |
|
|
81 |
|
|
|
82 |
- pushing to remote is described below. |
|
|
83 |
|
|
|
84 |
4. Before making changes etc. set up a development environment by running the following command in a virtual environment: |
|
|
85 |
|
|
|
86 |
```bash |
|
|
87 |
make dev |
|
|
88 |
make requirements |
|
|
89 |
``` |
|
|
90 |
|
|
|
91 |
5. Develop features on your branch. |
|
|
92 |
|
|
|
93 |
As you work on the features, you should make sure that the test suite passes: |
|
|
94 |
|
|
|
95 |
```bash |
|
|
96 |
$ make test |
|
|
97 |
``` |
|
|
98 |
|
|
|
99 |
Once you're happy with your changes, add changed files using `git add` and |
|
|
100 |
make a commit with `git commit` to record your changes locally: |
|
|
101 |
|
|
|
102 |
```bash |
|
|
103 |
$ git add modified_file.py |
|
|
104 |
$ git commit |
|
|
105 |
``` |
|
|
106 |
|
|
|
107 |
Please write [good commit messages](https://chris.beams.io/posts/git-commit/). |
|
|
108 |
|
|
|
109 |
It is a good idea to sync your copy of the code with the original |
|
|
110 |
repository regularly. This way you can quickly account for changes: |
|
|
111 |
|
|
|
112 |
```bash |
|
|
113 |
$ git fetch upstream |
|
|
114 |
$ git rebase upstream/main |
|
|
115 |
``` |
|
|
116 |
|
|
|
117 |
Push the changes to the development branch on your repository: |
|
|
118 |
|
|
|
119 |
```bash |
|
|
120 |
$ git push origin development |
|
|
121 |
``` |
|
|
122 |
|
|
|
123 |
6. Once you are satisfied (**and the checklist below is happy too**), go to the |
|
|
124 |
webpage of your fork on GitHub. Click on 'Pull request' to send your changes |
|
|
125 |
to the project maintainers for review. |
|
|
126 |
|
|
|
127 |
7. It's ok if maintainers ask you for changes. It happens to core contributors |
|
|
128 |
too! So everyone can see the changes in the Pull request, work in your local |
|
|
129 |
branch and push the changes to your fork. They will automatically appear in |
|
|
130 |
the pull request. |
|
|
131 |
|
|
|
132 |
|
|
|
133 |
Running tests should be done **before** pushing your changes to your respository to ensure that the code works. |
|
|
134 |
|
|
|
135 |
### Checklist |
|
|
136 |
|
|
|
137 |
1. Make the title of your pull request should be a summary of its contribution; |
|
|
138 |
2. If your pull request addresses an issue, mention the issue number in |
|
|
139 |
the pull request description |
|
|
140 |
3. If your PR is a work in progress, start the title with `[WIP]` |
|
|
141 |
4. Make sure existing tests pass; |
|
|
142 |
5. Add high-coverage tests. Additions without tests will not be merged |
|
|
143 |
|
|
|
144 |
### Tests |
|
|
145 |
|
|
|
146 |
Library tests can be found in the |
|
|
147 |
[tests folder](https://github.com/gattia/pymskt/tree/main/testing). |
|
|
148 |
|
|
|
149 |
From the root of the repository, here's how to run tests with `pytest` for the library: |
|
|
150 |
|
|
|
151 |
```bash |
|
|
152 |
$ make test |
|
|
153 |
``` |