Skip to content

Commit 0c75cd7

Browse files
author
Régis Longchamp
committed
feat: add code of conduct + contributing guidline + License
1 parent 6606086 commit 0c75cd7

File tree

4 files changed

+1044
-4
lines changed

4 files changed

+1044
-4
lines changed

CODE_OF_CONDUCT.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
# Contributor Covenant Code of Conduct
3+
4+
## Our Pledge
5+
6+
We as members, contributors, and leaders pledge to make participation in our
7+
community a harassment-free experience for everyone, regardless of age, body
8+
size, visible or invisible disability, ethnicity, sex characteristics, gender
9+
identity and expression, level of experience, education, socio-economic status,
10+
nationality, personal appearance, race, caste, color, religion, or sexual
11+
identity and orientation.
12+
13+
We pledge to act and interact in ways that contribute to an open, welcoming,
14+
diverse, inclusive, and healthy community.
15+
16+
## Our Standards
17+
18+
Examples of behavior that contributes to a positive environment for our
19+
community include:
20+
21+
* Demonstrating empathy and kindness toward other people
22+
* Being respectful of differing opinions, viewpoints, and experiences
23+
* Giving and gracefully accepting constructive feedback
24+
* Accepting responsibility and apologizing to those affected by our mistakes,
25+
and learning from the experience
26+
* Focusing on what is best not just for us as individuals, but for the overall
27+
community
28+
29+
Examples of unacceptable behavior include:
30+
31+
* The use of sexualized language or imagery, and sexual attention or advances of
32+
any kind
33+
* Trolling, insulting or derogatory comments, and personal or political attacks
34+
* Public or private harassment
35+
* Publishing others' private information, such as a physical or email address,
36+
without their explicit permission
37+
* Other conduct which could reasonably be considered inappropriate in a
38+
professional setting
39+
40+
## Enforcement Responsibilities
41+
42+
Community leaders are responsible for clarifying and enforcing our standards of
43+
acceptable behavior and will take appropriate and fair corrective action in
44+
response to any behavior that they deem inappropriate, threatening, offensive,
45+
or harmful.
46+
47+
Community leaders have the right and responsibility to remove, edit, or reject
48+
comments, commits, code, wiki edits, issues, and other contributions that are
49+
not aligned to this Code of Conduct, and will communicate reasons for moderation
50+
decisions when appropriate.
51+
52+
## Scope
53+
54+
This Code of Conduct applies within all community spaces, and also applies when
55+
an individual is officially representing the community in public spaces.
56+
Examples of representing our community include using an official e-mail address,
57+
posting via an official social media account, or acting as an appointed
58+
representative at an online or offline event.
59+
60+
## Enforcement
61+
62+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
63+
reported to the community leaders responsible for enforcement at
64+
[INSERT CONTACT METHOD].
65+
All complaints will be reviewed and investigated promptly and fairly.
66+
67+
All community leaders are obligated to respect the privacy and security of the
68+
reporter of any incident.
69+
70+
## Enforcement Guidelines
71+
72+
Community leaders will follow these Community Impact Guidelines in determining
73+
the consequences for any action they deem in violation of this Code of Conduct:
74+
75+
### 1. Correction
76+
77+
**Community Impact**: Use of inappropriate language or other behavior deemed
78+
unprofessional or unwelcome in the community.
79+
80+
**Consequence**: A private, written warning from community leaders, providing
81+
clarity around the nature of the violation and an explanation of why the
82+
behavior was inappropriate. A public apology may be requested.
83+
84+
### 2. Warning
85+
86+
**Community Impact**: A violation through a single incident or series of
87+
actions.
88+
89+
**Consequence**: A warning with consequences for continued behavior. No
90+
interaction with the people involved, including unsolicited interaction with
91+
those enforcing the Code of Conduct, for a specified period of time. This
92+
includes avoiding interactions in community spaces as well as external channels
93+
like social media. Violating these terms may lead to a temporary or permanent
94+
ban.
95+
96+
### 3. Temporary Ban
97+
98+
**Community Impact**: A serious violation of community standards, including
99+
sustained inappropriate behavior.
100+
101+
**Consequence**: A temporary ban from any sort of interaction or public
102+
communication with the community for a specified period of time. No public or
103+
private interaction with the people involved, including unsolicited interaction
104+
with those enforcing the Code of Conduct, is allowed during this period.
105+
Violating these terms may lead to a permanent ban.
106+
107+
### 4. Permanent Ban
108+
109+
**Community Impact**: Demonstrating a pattern of violation of community
110+
standards, including sustained inappropriate behavior, harassment of an
111+
individual, or aggression toward or disparagement of classes of individuals.
112+
113+
**Consequence**: A permanent ban from any sort of public interaction within the
114+
community.
115+
116+
## Attribution
117+
118+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119+
version 2.1, available at
120+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121+
122+
Community Impact Guidelines were inspired by
123+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124+
125+
For answers to common questions about this code of conduct, see the FAQ at
126+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127+
[https://www.contributor-covenant.org/translations][translations].
128+
129+
[homepage]: https://www.contributor-covenant.org
130+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131+
[Mozilla CoC]: https://github.com/mozilla/diversity
132+
[FAQ]: https://www.contributor-covenant.org/faq
133+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
# DISDRODB contributing guide
2+
3+
Hi! Thanks for taking the time to contribute to DISDRODB.
4+
5+
You can contribute in many ways :
6+
7+
- Join the [discussion](https://github.com/ltelab/disdrodb/discussions)
8+
9+
Before submitting your contribution, please make sure to take a moment and read through the following guidelines :
10+
11+
- [Code of Conduct](https://github.com/ltelab/disdrodb/blob/main/CODE_OF_CONDUCT.md)
12+
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
13+
- [Pull Request Guidelines](#pull-request-guidelines)
14+
- [Development Setup](#development-setup)
15+
- [Project Structure](#project-structure)
16+
- [Github Flow](#github-flow)
17+
- [Commit Lint](#commit-lint)
18+
19+
## Issue Reporting Guidelines
20+
21+
- Always use [ issue templates ](https://github.com/ltelab/disdrodb/issues/new/choose)
22+
- If you don't find a corresponding issue template please use the template to ask a new template
23+
24+
##
25+
26+
## Contribution Guidelines
27+
28+
**We Develop with Github !**
29+
30+
We use github to host code, to track issues and feature requests, as well as accept pull requests.
31+
32+
We Use [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow), So All Code Changes Happen Through Pull Requests
33+
34+
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow)). We actively welcome your pull requests:
35+
36+
## First Time Contributors
37+
38+
* Setting up the development environment
39+
* Install pre-commit hooks
40+
* Respect the Code Style guide
41+
42+
#### Setting up the development environment
43+
44+
You will need python to set up the development environment. See [README.md](https://github.com/ltelab/disdrodb/blob/main/README.md) for further explanations.
45+
46+
#### Install pre-commit hooks
47+
48+
After setting up your development environment, install the git pre-commit hook by executing the following command in the repository’s root:
49+
50+
```
51+
pre-commit install
52+
```
53+
54+
The pre-commit hooks are scripts executed automatically in every commit to identify simple issues with the code. When an issue is identified (the pre-commit script exits with non-zero status), the hook aborts the commit and prints the error. Currently, DISDRODB only tests that the code to be committed complies with black’s format style.
55+
In case that the commit is aborted, you only need to run black in the entire source code. This can be done by running `black .` or `pre-commit run --all-files`.
56+
The latter is recommended since it indicates if the commit contained any formatting errors (that are automatically corrected).
57+
58+
IMPORTANT: Periodically update the black version used in the pre-commit hook by running:
59+
60+
```
61+
pre-commit autoupdate
62+
```
63+
64+
#### Respect the Code Style guide
65+
66+
We follow the pep8 and the python-guide writing style
67+
68+
- [Code Style — The Hitchhiker's Guide to Python](https://docs.python-guide.org/writing/style/)
69+
70+
To ensure a minimal style consistency, we use [black](https://black.readthedocs.io/en/stable/) to auto-format to the source code.
71+
The black configuration used in the pysteps project is defined in the pyproject.toml,
72+
and it is automatically detected by black.
73+
74+
Black can be run using the following command :
75+
76+
```
77+
pre-commit run --all-file
78+
```
79+
80+
**Docstrings**
81+
82+
Every module, function, or class must have a docstring that describe its purpose and how to use it. The docstrings follows the conventions described in the [PEP 257](https://www.python.org/dev/peps/pep-0257/#multi-line-docstrings) and the [Numpy’s docstrings format](https://numpydoc.readthedocs.io/en/latest/format.html).
83+
84+
Here is a summary of the most important rules:
85+
86+
- Always use triple quotes for doctrings, even if it fits a single line.
87+
88+
- For one-line docstring, end the phrase with a period.
89+
90+
- Use imperative mood for all docstrings (“””Return some value.”””) rather than descriptive mood (“””Returns some value.”””).
91+
92+
Here is an example of a docstring:
93+
94+
```
95+
def adjust_lag2_corrcoef1(gamma_1, gamma_2):
96+
"""
97+
A simple adjustment of lag-2 temporal autocorrelation coefficient to
98+
ensure that the resulting AR(2) process is stationary when the parameters
99+
are estimated from the Yule-Walker equations.
100+
101+
Parameters
102+
----------
103+
gamma_1 : float
104+
Lag-1 temporal autocorrelation coeffient.
105+
gamma_2 : float
106+
Lag-2 temporal autocorrelation coeffient.
107+
108+
Returns
109+
-------
110+
out : float
111+
The adjusted lag-2 correlation coefficient.
112+
"""
113+
```
114+
115+
## How to contribute ?
116+
117+
Here is a brief overview of the contribution steps that each DISDRODB must follow.
118+
119+
1. Fork the repository.
120+
2. Create a new branch for each contribution.
121+
3. Work on your changes.
122+
4. Test your changes.
123+
5. Push you changes to your fork repository.
124+
6. Create a new Pull Request in GitHub.
125+
126+
#### Fork the repository
127+
128+
Once you have set the development environment, the next step is creating your local copy of the repository, where you will commit your modifications. The steps to follow are:
129+
130+
1. Set up Git on your computer
131+
132+
2. Create a GitHub account (if you don’t have one)
133+
134+
3. Fork the repository in your GitHub.
135+
136+
4. Clone a local copy of your fork. For example:
137+
138+
```
139+
git clone https://github.com/<your-account>/disdrodb.git
140+
```
141+
142+
Done!, now you have a local copy of disdrodb git repository.
143+
144+
#### Create a new branch
145+
146+
As a collaborator, all the new contributions you want should be made in a new branch under your forked repository. Working on the master branch is reserved for Core Contributors only. Core Contributors are developers that actively work and maintain the repository. They are the only ones who accept pull requests and push commits directly to the pysteps repository.
147+
148+
For more information on how to create and work with branches, see [“Branches in a Nutshell”](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell) in the Git documentation
149+
150+
Branch name must be define as follow :
151+
152+
- Add a reader: `reader-<institute>-<campaign>`
153+
- Fix a bug: `bugfix-<some_key>-<word>`
154+
- Improve the doc: `doc-<some_key>-<word>`
155+
- Add a new feature: `feature-<some_key>-<word>`
156+
- Refactor some code: `refactor-<some_key>-<word>`
157+
- Optimize some code: `optimize-<some_key>-<word>`
158+
159+
#### Work on your changes
160+
161+
Here again, respect the Respect the Code Style guide.
162+
163+
#### Test of changes
164+
165+
todo
166+
167+
#### Push you changes to your fork repository
168+
169+
During this process, pre-commit hooks will be run. Your commit will be allowed only if quality requirements are fulfil.
170+
171+
If you encounter errors, Black can be run using the following command :
172+
173+
```
174+
pre-commit run --all-file
175+
```
176+
177+
We follow a commit message convention, to have consistent git messages. The goal is to increase readability and ease of contribution
178+
179+
- we use [commit-lint](https://github.com/conventional-changelog/commitlint)
180+
181+
#### Create a new Pull Request in GitHub.
182+
183+
Once your code has been uploaded into your DISTRODB fork, you can create a Pull request to the DISDRODB main branch.
184+
185+
**Recommendation for the pull request**
186+
187+
- Add screenshots or GIFs for any UI changes. This will help the person reviewing your code to understand what you’ve changed and how it works.
188+
189+
- *Hint: use [Kap](https://getkap.co/) or [Licecap](https://www.cockos.com/licecap/) to record your screen.*
190+
191+
- If your team uses the particular template provided for pull requests, fill it.
192+
193+
- It's OK to have multiple small commits as you work on the PR - GitHub will automatically squash it before merging.
194+
195+
- If adding a new feature:
196+
197+
- Add accompanying test case.
198+
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
199+
- Present your issue in the 'discussion' part of this repo
200+
201+
- If fixing bug:
202+
203+
- If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`.
204+
- Provide a detailed description of the bug in the PR. Live demo preferred.
205+
- Add appropriate test coverage if applicable.
206+
207+
##
208+
209+
## Code review checklist
210+
211+
- Ask to people to review your code:
212+
- a person who knows the domain well and can spot bugs in the business logic;
213+
- an expert in the technologies you’re using who can help you improve the code quality.
214+
- When you’re done with the changes after a code review, do another self review of the code and write a comment to notify the reviewer, that the pull request is ready for another iteration.
215+
- Review all the review comments and make sure they are all addressed before the next review iteration.
216+
- Make sure you don’t have similar issues anywhere else in your pull request.
217+
- If you’re not going to follow any of the code review recommendations, please add a comment explaining why.
218+
- Avoid writing comment like "done" of "fixed" on each code review comment. Reviewers assume you’ll do all suggested changes, unless you have a reason not to do some of them.
219+
- Sometimes it’s okay to postpone changes — in this case you’ll need to add a ticket number to the pull request and to the code itself.
220+
221+
##
222+
223+
## Financial Contribution
224+
225+
We also welcome financial contributions. Please contact us directly.
226+
227+
## Credits
228+
229+
Thank you to all the people who have already contributed to DISDRDB repository!

0 commit comments

Comments
 (0)