You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 📝 Docs(CONTRIBUTING.md): Update contrib files based on the acore guide and adding extra info about code and doc strandards
* 📝 Docs(.github/PULL_REQUEST_TEMPLATE/README.md): Created README to explain how to use PR templates
* 🎨 Style(CONTRIBUTING.md): fix acore broken link and add style on the initial description
* ✏️ Style(CONTRIBUTING.md): fix typo in PR General Guidelines
* 📝 Docs(CONTRIBUTING.md): Add test guidelines section
See the [GitHub documentation](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository) for more information.
[VueCore][vuecore-repo] is an open source project, and we welcome contributions of all
4
-
kinds via GitHub issues and pull requests: correct or improve our [documentation][vuecore-docs], report or fix bugs, propose changes, and implement new features. Please follow
5
-
these guidelines to make sure that your contribution is easily integrated into the project.
3
+
[VueCore][vuecore-repo] is an **open source project**, and we welcome contributions of all kinds via **GitHub issues** and
4
+
**pull requests**: correct or improve our [documentation][vuecore-docs], report or fix bugs, propose changes, and
5
+
implement new features. Please follow these guidelines to make sure that your contribution is easily integrated
6
+
into the project.
6
7
7
-
## 1. Contributor Agreement
8
+
## Contributor Agreement
8
9
9
10
By contributing, you agree that we may redistribute your work under [our
10
11
license](LICENSE.md). In exchange, we will address your issues and/or assess
11
12
your change proposal as promptly as we can, and help you become a member of our
12
13
community.
13
14
14
-
## 2. What to Contribute
15
+
## What to Contribute?
15
16
16
-
The easiest way to get started is by reporting an issue that needs to be fixed,
17
-
such as a bug in the code, unclear explanations, conceptual errors, or other details.
18
-
You can also contribute by proposing new features or modules, improving existing
19
-
functionality, or suggesting other ideas that might be useful. If you’re looking for
20
-
inspiration, please check the [list of open issues][issues] in this repository.
17
+
The easiest way to get started is by **reporting an issue** that needs to be fixed,
18
+
such as a bug in the code, unclear explanations, conceptual errors, or other details.
19
+
If you are familiar with Python, Git,, and GitHub, you can **fix the bug** yourself
20
+
and submit a **pull request (PR)** with your changes, as described below.
21
+
22
+
You can also contribute by **fixing existing bugs** tagged with the `bug` and
23
+
`help wanted` labels in the [list of open issues][issues] of the repository. There are
24
+
**new features and imporvements** tagged with `enhancement` and `help wanted` as well, so
25
+
feel free to start a discussion if you would like to work on one of those. If you come up with
26
+
any **ideas for new features or improvements** that are not yet reported, we are also happy to hear about them.
21
27
22
28
Feedback from beginners is especially valuable, as experienced users may overlook how
23
29
challenging certain aspects of the software can be for newcomers. Therefore, we encourage
24
-
you to share any suggestions or observations you have about this project.
30
+
you to share any suggestions or observations you have.
25
31
26
-
## 3. How to Contribute
32
+
## How to Contribute?
27
33
28
34
Here are the ways you can submit your suggestions and contribute to the project:
29
35
30
36
### 1. Reporting Issues or Suggesting Improvements
31
37
32
-
If you have a [GitHub][github] account (or are willing to [open one][github-join]) but are unfamiliar with Git, you can report bugs or suggest improvements by [creating an issue][new-issue]. This GitHub feature allows for discussion threads on reported issues and proposed enhancements.
38
+
If you have a [GitHub][github] account (or are willing to [open one][github-join]) but are unfamiliar with
39
+
Git, you can report bugs or suggest improvements by [creating an issue][new-issue]. This GitHub feature allows
40
+
for discussion threads on reported issues and proposed enhancements.
41
+
42
+
When reporting an issue, please provide as much relevant information as possible, including:
43
+
44
+
* A clear and descriptive title
45
+
* A detailed description of the problem or suggestion
46
+
* Steps to reproduce the issue (if applicable)
47
+
* Any relevant screenshots or error messages
48
+
* Your operating system, software version, and additonal details about your local setup that might be helpful in troubleshooting
49
+
50
+
> [!TIP]
51
+
> This guide from the [GitHub Docs][github-docs] provides useful tips on [how to write an issue][issue-github-guide].
52
+
53
+
### 2. Submitting Changes via Pull Requests (PR)
54
+
55
+
If you are comfortable using Git/GitHub and would like to add or modify a functionality, you can submit a **PR**.
56
+
You may want to look at [How to Contribute to an Open Source Project on GitHub][how-contribute].
57
+
In brief, we use [GitHub flow][github-flow] to manage changes:
58
+
59
+
> [!TIP]
60
+
> Consider using an IDE (e.g., [VSCode][vscode]) or a GUI client (e.g., [GitHub Desktop][github-desktop]) to help
61
+
> you with some of the common steps described below.
62
+
63
+
1. Fork the [vuecore][vuecore-repo] repo on GitHub.
64
+
2. Clone your fork locally. Replace `yourusername` with your GitHub username.
3. Install your local copy into a virtual environment. Assuming you have Python available
71
+
on your system, this can be done using `venv`. Alternatives are `conda`, `uv`, or `poetry`
72
+
to create and manage virtual environments.
73
+
74
+
```bash
75
+
cd vuecore/
76
+
python -m venv .env
77
+
source .env/bin/activate
78
+
pip install -e .[dev]
79
+
```
33
80
34
-
### 2. Submitting Changes via Pull Requests
81
+
4. Create a new branch in your desktop copy of this repository for each significant change.
35
82
36
-
If you are comfortable using Git and would like to add or modify a functionality, you can submit a **pull request (PR)**. Instructions on how to contribute this way are provided in the next section.
83
+
```bash
84
+
git checkout -b name-of-your-new-branch
85
+
```
37
86
38
-
> [!NOTE]
39
-
> The documentation for [Git][git-docs] and [GitHub][github-docs] are easy to follow, and you can learn the basics using their official guides.
87
+
5. When you're done making changes, check that your changes are formatted and pass `black` and
88
+
`ruff` checks (some changes ruff can automatically fix for you, if you pass the `--fix` flag).
89
+
Also, run the `tests` to make sure everything is working as expected:
40
90
41
-
## 3. Creating a Pull Request
91
+
```bash
92
+
black .
93
+
ruff check src
94
+
pytest .
95
+
```
42
96
43
-
If you choose to contribute via GitHub, you may want to look at [How to Contribute to an Open Source Project on GitHub][how-contribute]. In brief, we use [GitHub flow][github-flow] to manage changes:
97
+
6. Commit the changea in that branch.
44
98
45
-
1. Create a new branch in your desktop copy of this repository for each significant change.
46
-
2. Commit the change in that branch.
47
-
3. Push that branch to your fork of this repository on GitHub.
48
-
4. Submit a pull request from that branch to the [upstream repository][vuecore-repo].
49
-
5. If you receive feedback, make changes on your desktop and push to your branch on GitHub: the
99
+
```bash
100
+
git add .
101
+
git commit -m "Your detailed description of your changes."
102
+
```
103
+
104
+
7. Push that branch to your fork of this repository on GitHub.
105
+
106
+
```bash
107
+
git push origin name-of-your-new-branch
108
+
```
109
+
110
+
8. Submit a pull request from that branch to the [upstream repository][vuecore-repo] via GitHub.
111
+
See the **PR General Guidelines** below for more details.
112
+
9. If you receive feedback, make changes on your desktop and push to your branch on GitHub: the
50
113
pull request will update automatically.
51
114
52
-
## 5. Credits
115
+
> [!TIP]
116
+
> The documentation for [Git][git-docs] and [GitHub][github-docs] are easy to follow, and you can learn the
117
+
> basics using their official guides.
118
+
119
+
#### PR General Guidelines
120
+
121
+
We have a general [PR template][general-pr-template] that is loaded autmatically when you open a new PR.
122
+
Also, if you are adding a new plot, we created a [new plot PR template][new-plot-pr-template]
123
+
with a checklist of all the steps to follow, which you can use with a query paramter by clicking [here][new-plot-pr-query-param].
124
+
125
+
Before you submit a PR, check that it meets these guidelines:
126
+
127
+
1. The pull request should include tests.
128
+
2. If the pull request adds functionality, the docs should be updated. Put
129
+
your new functionality into a function with a docstring.
130
+
3. The pull request should pass the workflows on GitHub.
131
+
132
+
## Code & Documentation Standards
133
+
134
+
To maintain consistency across the codebase, please adhere to the following standards when contributing:
135
+
136
+
***Docstrings:** Follow the [NumPy docstring style][numpy-docstring-guide]. Include examples where relevant.
137
+
***Type Hints:** Use Python type hints for function signatures and variable annotations (**PEP 484**).
138
+
***Code Formatting:** Use `black` for code formatting and `ruff` for linting (as mentioned in the PR guidelines).
139
+
***Naming Conventions:** Follow **PEP8** for naming (e.g., snake_case for variables/functions, CamelCase for classes).
140
+
141
+
Here is an example of a simple function with a proper docstring and type hints:
53
142
54
-
This contribution guide was modified under the [Creative Commons Attribution 4.0 International License][ccby] from the [Software Carpentry guides][soft-cp-guides].
Calculate the average of a list of numerical values.
147
+
148
+
Parameters
149
+
----------
150
+
values : List[float]
151
+
List of numerical values to average.
152
+
153
+
Returns
154
+
-------
155
+
float
156
+
The arithmetic mean of the input values.
157
+
158
+
Examples
159
+
--------
160
+
>>> calculate_average([1.0, 2.0, 3.0, 4.0])
161
+
2.5
162
+
"""
163
+
returnsum(values) /len(values)
164
+
```
165
+
166
+
## Test Guidelines
167
+
168
+
We encourage comprehensive testing to maintain code quality, so all contributions should include
169
+
appropriate tests that verify functionality. We use `pytest` as our testing framework. Here are some considerations:
170
+
171
+
***Structure:** Place tests in the tests/ directory, mirroring the source structure.
172
+
***Coverage:** Aim for high test coverage, especially for new features or bug fixes. Try to cover typical use cases as well as edge cases.
173
+
***Naming:** Use descriptive test function names that indicate what is being tested.
174
+
***Docstrings:** Include docstrings in your test functions to explain their purpose, following the previous docstring guidelines.
175
+
***Isolation:** Each test should be independent and not rely on other tests.
176
+
***Local Execution:** Ensure that tests can be run locally using `pytest` before submitting a PR.
177
+
178
+
Here is an example of a test script for the `calculate_average` function:
179
+
180
+
```python
181
+
import pytest
182
+
from vuecore.utils import calculate_average
183
+
184
+
deftest_calculate_average_basic():
185
+
"""Test basic average calculation with positive numbers."""
186
+
result = calculate_average([1.0, 2.0, 3.0, 4.0])
187
+
assert result ==2.5
188
+
189
+
deftest_calculate_average_single_value():
190
+
"""Test average calculation with a single value."""
191
+
result = calculate_average([5.0])
192
+
assert result ==5.0
193
+
194
+
deftest_calculate_average_empty_list():
195
+
"""Test average calculation with empty list raises appropriate error."""
196
+
with pytest.raises(ZeroDivisionError):
197
+
calculate_average([])
198
+
```
199
+
200
+
Run the following command in the root directory to execute the tests locally:
201
+
202
+
```bash
203
+
pytest .
204
+
```
205
+
206
+
It's possible to run specific test files or functions by providing their paths.
207
+
See the [pytest documentation][pytest-docs] for more details.
208
+
209
+
## Deployment
210
+
211
+
We created a [CI/CD worflow][cicd-workflow] using **GitHub Actions** to automatically deploy the Python package to
212
+
[PyP][vuecore-pypi] when a new release is created. To create a new release, make sure all changed are merged into the `main` branch,
213
+
then go to the [Releases section][releases-vuecore] of the GitHub repository and click on **Draft a new release**. Fill in the
214
+
release title and description, then click on **Publish release**. This will trigger the GitHub Actions workflow to build and deploy the package to PyPI.
215
+
216
+
Also, we have a GitHub Action that automatically deploys the documentation to [Read the Docs][vuecore-docs] in
217
+
every push to a branch or when a PR is merged into `main`.
218
+
219
+
## Credits
220
+
221
+
This contribution guide was modified under the [Creative Commons Attribution 4.0 International License][ccby] from
222
+
the [Software Carpentry guides][soft-cp-guides] and the [acore][acore-repo] project.
0 commit comments