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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+46-65Lines changed: 46 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
* make your changes
8
8
* run the style checkers: `nox -s style`
9
9
* add your changed files: `git add .`
10
-
* once the style checks pass, commit your changes using the Conventional Commit: `git commit -m "feat: a short description of your changes"`
10
+
* once the style checks pass, commit your changes: `git commit -m "a short description of your changes"`
11
11
* push your changes: `git push -u origin new-branch`
12
12
*[make a Pull Request](http://makeapullrequest.com/) for your branch from the main GitHub repository [PR page](https://github.com/mdtanker/polartoolkit/pulls).
13
13
@@ -42,29 +42,41 @@ contributions.
42
42
43
43
## Contents
44
44
45
-
*[What Can I Do?](#what-can-i-do)
46
-
*[Reporting a Bug](#reporting-a-bug)
47
-
*[Editing the Documentation](#editing-the-documentation)
48
-
*[Contributing Code](#contributing-code)
49
-
-[General guidelines](#general-guidelines)
50
-
-[Fork the repository](#fork-the-repository)
51
-
-[Clone the repository](#clone-the-repository)
52
-
-[Setting up Nox](#setting-up-nox)
53
-
-[Setting up your environment](#setting-up-your-environment)
54
-
-[Make a branch](#make-a-branch)
55
-
-[Make your changes](#make-your-changes)
56
-
-[Testing your code](#testing-your-code)
57
-
-[Documentation](#documentation)
58
-
-[Committing changes](#committing-changes)
59
-
-[Push your changes](#push-your-changes)
60
-
-[Open a PR](#open-a-pr)
61
-
-[Code review](#code-review)
62
-
-[Sync your fork and local](#sync-your-fork-and-local)
63
-
-[Add yourself as an author](#add-yourself-as-an-author)
64
-
*[Publish a new release](#publish-a-new-release)
65
-
*[Update the Dependencies](#update-the-dependencies)
66
-
*[Create a conda environment file](#create-a-conda-environment-file)
67
-
*[Set up Binder](#set-up-the-binder-configuration)
-[Editing the Documentation](#editing-the-documentation)
51
+
-[Contributing Code](#contributing-code)
52
+
-[General guidelines](#general-guidelines)
53
+
-[Fork the repository](#fork-the-repository)
54
+
-[Clone the repository](#clone-the-repository)
55
+
-[Setting up `nox`](#setting-up-nox)
56
+
-[Setting up your environment](#setting-up-your-environment)
57
+
-[Make a branch](#make-a-branch)
58
+
-[Make your changes](#make-your-changes)
59
+
-[Code style and linting](#code-style-and-linting)
60
+
-[Docstrings](#docstrings)
61
+
-[Type hints](#type-hints)
62
+
-[Logging](#logging)
63
+
-[Testing your code](#testing-your-code)
64
+
-[Documentation](#documentation)
65
+
-[Run all .ipynb's to update them](#run-all-ipynbs-to-update-them)
66
+
-[Check the build manually (optional)](#check-the-build-manually-optional)
67
+
-[Automatically build the docs](#automatically-build-the-docs)
68
+
-[Committing changes](#committing-changes)
69
+
-[Push your changes](#push-your-changes)
70
+
-[Open a PR](#open-a-pr)
71
+
-[Code review](#code-review)
72
+
-[Sync your fork and local](#sync-your-fork-and-local)
73
+
-[Add yourself as an author](#add-yourself-as-an-author)
74
+
-[Publish a new release](#publish-a-new-release)
75
+
-[PyPI (pip)](#pypi-pip)
76
+
-[Conda-Forge](#conda-forge)
77
+
-[Update the dependencies](#update-the-dependencies)
78
+
-[Create a conda environment file](#create-a-conda-environment-file)
79
+
-[Set up the binder configuration](#set-up-the-binder-configuration)
68
80
69
81
## What Can I Do?
70
82
@@ -219,9 +231,9 @@ We use [pre-commit](https://pre-commit.com/) to check code style. This can be us
219
231
nox -s lint
220
232
```
221
233
222
-
To have `pre-commit` run automatically on commits, install it with `pre-commit install`
234
+
To have `pre-commit`locally run automatically on commits, install it with `pre-commit install`. `pre-commit` will also automatically run for any commits to GitHub.
223
235
224
-
Go through the output of this and try to change the code based on the errors. Search the error codes on the [Ruff documentation](https://docs.astral.sh/ruff/), which should give suggestions. Re-run the check to see if you've fixed it. Somethings can't be resolved (unsplittable urls longer than the line length). For these, add `# noqa: []` at the end of the line and the check will ignore it. Inside the square brackets add the specific error code you want to ignore.
236
+
Go through the output of the `pre-commit` logs and try to change the code based on the errors. Search the error codes on the [Ruff documentation](https://docs.astral.sh/ruff/), which should give suggestions. Re-run the check to see if you've fixed it. Somethings can't be resolved (unsplittable urls longer than the line length). For these, add `# noqa: []` at the end of the line and the check will ignore it. Inside the square brackets add the specific error code you want to ignore.
225
237
226
238
We also use [Pylint](https://pylint.readthedocs.io/en/latest/), which performs static-linting on the code. This checks the code and catches many common bugs and errors, without running any of the code. This check is slightly slower the the `Ruff` check. Run it with the following:
227
239
```
@@ -289,7 +301,7 @@ Leave a comment in the PR and we'll help you out.
289
301
290
302
### Documentation
291
303
292
-
The Docs are build with [Sphinx](https://www.sphinx-doc.org/en/master/) and hosted on [Read the Docs](https://about.readthedocs.com/). Due to the above mentioned issues with the included C programs, `Read the Docs (RTD)` can't run the scripts which are part of the docs (i.e. the gallery examples). Because of this the notebooks don't execute on a build, as specified by `execute_notebooks: 'off'` in `_config.yml`. Here is how to run/update the docs on your local machine.
304
+
The Docs are build with [Sphinx](https://www.sphinx-doc.org/en/master/) and hosted on [Read the Docs](https://about.readthedocs.com/). Due to the above mentioned issues with the included C programs, `Read the Docs (RTD)` can't run the scripts which are part of the docs (i.e. the gallery examples). Because of this the notebooks don't execute on a build, as specified by `execute_notebooks: 'off'` in `docs/config.py`. Here is how to run/update the docs on your local machine.
293
305
294
306
> **Note:** The docs are automatically built on PR's by `RTD`, but it's good practice to build them manually before a PR, to check them for errors.
295
307
@@ -303,14 +315,15 @@ If your edits haven't changed any part of the core package, then there is no nee
303
315
304
316
You can build the docs using:
305
317
```bash
306
-
nox -s docs
318
+
nox -s build_api_docs
307
319
```
308
320
309
-
or if you don't want them to automatically update
310
321
```bash
311
-
nox -s docs --non-interactive
322
+
nox -s docs
312
323
```
313
324
325
+
Click the link to open your docs in a website which will automatically update as you make edits.
326
+
314
327
#### Automatically build the docs
315
328
316
329
Add, commit, and push all changes to GitHub in a Pull Request, and `RTD` should automatically build the docs.
@@ -321,41 +334,9 @@ In each PR, you will see section of the checks for `RTD`. Click on this to previ
321
334
322
335
### Committing changes
323
336
324
-
Once your have made your changes to your branch of your forked repository, you'll need to commit the changes to your remote fork. We use the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages. This helps users and developers understand what types of changes have been implemented in a PR or between versions.
325
-
```
326
-
<type>: <description>
327
-
328
-
[optional body]
329
-
```
330
-
331
-
Where `type` is one of the following:
332
-
*`docs` --> a change to the documents
333
-
*`style`--> simple fixes to the styling of the code
334
-
*`feat` --> any new features
335
-
*`fix` --> bug fixes
336
-
*`build` --> changes to the package build process, i.e. dependencies, changelogs etc.
337
-
*`chore` --> maintenance changes, like GitHub Action workflows
338
-
*`refactor` --> refactoring of the code without user-seen changes
339
-
340
-
The `optional body` can include any detailed description.
341
-
342
-
Based on the commit types in a PR, one of four things will happen when;
343
-
1) no new version will be released
344
-
2) a `PATCH` version will be released (`v1.1.0 -> v1.1.1`)
345
-
3) a `MINOR` version will be released (`v1.1.0 -> v1.2.0`)
346
-
4) a `MAJOR` version will be released (`v1.1.0 -> v2.0.0`)
347
-
348
-
This follows [Semantic Versioning](https://semver.org/#summary) where given a version number `MAJOR.MINOR.PATCH`, the software should increment the:
349
-
1)`MAJOR` version when you make incompatible API changes
350
-
2)`MINOR` version when you add functionality in a backward compatible manner
351
-
3)`PATCH` version when you make backward compatible bug fixes
352
-
353
-
While we decide this manually, generally the following will occur based on commit messages in your PR:
354
-
355
-
*`feat` will always result in a `MINOR` release
356
-
*`fix` will always result in a `PATCH` release
337
+
Once your have made your changes to your branch of your forked repository, you'll need to commit the changes to your remote fork.
357
338
358
-
Committing can be done interactively, if you use a editor like `VS Code`, or in the terminal.
339
+
This can be done interactively, if you use a editor like `VS Code`, or in the terminal.
359
340
360
341
Stage your changes for a file:
361
342
```bash
@@ -369,7 +350,7 @@ git add <directory>
369
350
370
351
Then commit those staged changes:
371
352
```bash
372
-
git commit -m "fix: a short description of your fix"
353
+
git commit -m "a short description of your changes"
0 commit comments