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
-[#141](https://github.com/pybop-team/PyBOP/pull/141) - Adds documentation with Sphinx and PyData Sphinx Theme. Updates docstrings across package, relocates `costs` and `dataset` to top-level of package. Adds noxfile session and deployment workflow for docs.
11
+
-[#131](https://github.com/pybop-team/PyBOP/issues/131) - Adds `SciPyDifferentialEvolution` optimiser, adds functionality for user-selectable maximum iteration limit to `SciPyMinimize`, `NLoptOptimize`, and `BaseOptimiser` classes.
12
+
-[#107](https://github.com/pybop-team/PyBOP/issues/107) - Adds Equivalent Circuit Model (ECM) with examples, Import/Export parameter methods `ParameterSet.import_parameter` and `ParameterSet.export_parameters`, updates default FittingProblem.signal definition to `"Voltage [V]"`, and testing infrastructure
13
+
-[#127](https://github.com/pybop-team/PyBOP/issues/127) - Adds Windows and macOS runners to the `test_on_push` action
14
+
-[#114](https://github.com/pybop-team/PyBOP/issues/114) - Adds standard plotting class `pybop.StandardPlot()` via plotly backend
15
+
-[#114](https://github.com/pybop-team/PyBOP/issues/114) - Adds `quick_plot()`, `plot_convergence()`, and `plot_cost2d()` methods
16
+
-[#114](https://github.com/pybop-team/PyBOP/issues/114) - Adds a SciPy minimize example and logging for non-Pints optimisers
17
+
-[#116](https://github.com/pybop-team/PyBOP/issues/116) - Adds PSO, SNES, XNES, ADAM, and IPropMin optimisers to PintsOptimisers() class
18
+
-[#38](https://github.com/pybop-team/PyBOP/issues/38) - Restructures the Problem classes ahead of adding a design optimisation example
19
+
-[#120](https://github.com/pybop-team/PyBOP/issues/120) - Updates the parameterisation test settings including the number of iterations
20
+
-[#145](https://github.com/pybop-team/PyBOP/issues/145) - Reformats Dataset to contain a dictionary and signal into a list of strings
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+35-13Lines changed: 35 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,23 @@
1
-
# Contributing to PyBOP
1
+
# Contributing
2
2
3
-
If you'd like to contribute to PyBOP, please have a look at the [pre-commit](#pre-commit-checks) and the [workflow](#workflow)guidelines below.
3
+
If you'd like to contribute to PyBOP, please have a look at the guidelines below.
4
4
5
+
## Developer-Installation
6
+
7
+
To install PyBOP for development purposes, which includes the testing and plotting dependencies, use the `[all]` flag as demonstrated below:
8
+
9
+
For `zsh`:
10
+
11
+
```sh
12
+
pip install -e '.[all]'
13
+
```
14
+
For `bash`:
15
+
```sh
16
+
pip install -e .[all]
17
+
```
5
18
## Pre-commit checks
6
19
7
-
Before you commit any code, please perform the following checks:
20
+
Before you commit any code, please perform the following checks using [Nox](https://nox.thea.codes/en/stable/index.html):
8
21
9
22
-[All tests pass](#testing): `$ nox -s unit`
10
23
@@ -17,7 +30,7 @@ pip install pre-commit
17
30
pre-commit install
18
31
```
19
32
20
-
This would run the checks every time a commit is created locally. The checks will only run on the files modified by that commit, but the checks can be triggered for all the files using -
33
+
This would run the checks every time a commit is created locally. The checks will only run on the files modified by that commit, but the checks can be triggered for all the files using,
21
34
22
35
```bash
23
36
pre-commit run --all-files
@@ -34,7 +47,7 @@ We use [GIT](https://en.wikipedia.org/wiki/Git) and [GitHub](https://en.wikipedi
34
47
1. Create an [issue](https://guides.github.com/features/issues/) where new proposals can be discussed before any coding is done.
35
48
2. Create a [branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) of this repo (ideally on your own [fork](https://help.github.com/articles/fork-a-repo/)), where all changes will be made
36
49
3. Download the source code onto your local system, by [cloning](https://help.github.com/articles/cloning-a-repository/) the repository (or your fork of the repository).
37
-
4.[Install](Developer-Install) PyBOP with the developer options.
50
+
4.[Install](#developer-installation) PyBOP with the developer options.
38
51
5.[Test](#testing) if your installation worked: `$ pytest --unit -v`.
39
52
40
53
You now have everything you need to start making changes!
ruff is configured inside the file `pre-commit-config.yaml`, allowing us to ignore some errors. If you think this should be added or removed, please submit an [issue](#issues)
85
+
ruff is configured inside the file `pre-commit-config.yaml`, allowing us to ignore some errors. If you think this should be added or removed, please submit an [issue](https://guides.github.com/features/issues/).
73
86
74
87
When you commit your changes they will be checked against ruff automatically (see [Pre-commit checks](#pre-commit-checks)).
75
88
@@ -113,6 +126,16 @@ def plot_great_things(self, x, y, z):
113
126
114
127
This allows people to (1) use PyBOP without ever importing Matplotlib and (2) configure Matplotlib's back-end in their scripts, which _must_ be done before e.g. `pyplot` is first imported.
115
128
129
+
### Building documentation
130
+
131
+
We use [Sphinx](http://www.sphinx-doc.org/en/stable/) to build our documentation. A [Nox](https://nox.thea.codes/en/stable/index.html) session has been created to reduce the overhead when building the documentation locally. To run this session, type
132
+
133
+
```bash
134
+
nox -s docs
135
+
```
136
+
137
+
This will build the docs using sphinx-autobuild and render them in your browser.
138
+
116
139
## Testing
117
140
118
141
All code requires testing. We use the [pytest](https://docs.pytest.org/en/) package for our tests. (These tests typically just check that the code runs without error, and so, are more _debugging_ than _testing_ in a strict sense. Nevertheless, they are very useful to have!)
@@ -123,7 +146,7 @@ If you have nox installed, to run unit tests, type
123
146
nox -s unit
124
147
```
125
148
126
-
else, type
149
+
Alternatively, to run tests standalone with pytest, run,
127
150
128
151
```bash
129
152
pytest --unit -v
@@ -270,7 +293,7 @@ Configuration files:
270
293
setup.py
271
294
```
272
295
273
-
Note that this file must be kept in sync with the version number in [pybop/**init**.py](pybop/__init__.py).
296
+
Note that this file must be kept in sync with the version number in [pybop/**init**.py](https://github.com/pybop-team/PyBOP/blob/develop/pybop/__init__.py).
274
297
275
298
### Continuous Integration using GitHub actions
276
299
@@ -293,11 +316,10 @@ Code coverage (how much of our code is seen by the (Linux) unit tests) is tested
293
316
294
317
GitHub does some magic with particular filenames. In particular:
295
318
296
-
- The first page people see when they go to [our GitHub page](https://github.com/pybop-team/PyBOP) displays the contents of [README.md](README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/).
297
-
- The licensefor using PyBOP is stored in [LICENSE](LICENSE.txt), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
298
-
- This file, [CONTRIBUTING.md](CONTRIBUTING.md) is recognised as the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created.
319
+
- The first page people see when they go to [our GitHub page](https://github.com/pybop-team/PyBOP) displays the contents of [README.md](https://github.com/pybop-team/PyBOP/blob/develop/README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/).
320
+
- The licensefor using PyBOP is stored in [LICENSE](https://github.com/pybop-team/PyBOP/blob/develop/LICENSE), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
321
+
- This file, [CONTRIBUTING.md](https://github.com/pybop-team/PyBOP/blob/develop/CONTRIBUTING.md) is recognised as the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created.
299
322
300
323
## Acknowledgements
301
324
302
-
This CONTRIBUTING.md file, along with large sections of the code infrastructure,
303
-
was copied from the excellent [Pints repo](https://github.com/pints-team/pints), and [PyBaMM repo](https://github.com/pybamm-team/PyBaMM)
325
+
This CONTRIBUTING.md file, along with large sections of the code infrastructure, was copied from the excellent [Pints repo](https://github.com/pints-team/pints), and [PyBaMM repo](https://github.com/pybamm-team/PyBaMM)
0 commit comments