Skip to content

Commit 3b7a572

Browse files
merge develop
2 parents 1fe0c9e + 728eda4 commit 3b7a572

File tree

343 files changed

+1646
-776
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+1646
-776
lines changed

.all-contributorsrc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,18 @@
550550
"avatar_url": "https://avatars.githubusercontent.com/u/112731474?v=4",
551551
"profile": "https://github.com/iatzak",
552552
"contributions": [
553-
"doc"
553+
"doc",
554+
"bug",
555+
"code"
556+
]
557+
},
558+
{
559+
"login": "ayeankit",
560+
"name": "Ankit Kumar",
561+
"avatar_url": "https://avatars.githubusercontent.com/u/72691866?v=4",
562+
"profile": "https://github.com/ayeankit",
563+
"contributions": [
564+
"code"
554565
]
555566
}
556567
],

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Please add a line in the relevant section of [CHANGELOG.md](https://github.com/p
1414

1515
# Key checklist:
1616

17-
- [ ] No style issues: `$ flake8`
17+
- [ ] No style issues: `$ pre-commit run`
1818
- [ ] All tests pass: `$ python run-tests.py --unit`
1919
- [ ] The documentation builds: `$ cd docs` and then `$ make clean; make html`
2020

.github/workflows/benchmark_on_push.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@ jobs:
1111
uses: actions/setup-python@v4
1212
with:
1313
python-version: 3.8
14-
- name: Install asv
15-
run: pip install -U pip virtualenv asv
14+
- name: Install Linux system dependencies
15+
run: |
16+
sudo apt-get update
17+
sudo apt install gfortran gcc libopenblas-dev
18+
- name: Install python dependencies
19+
run: |
20+
python -m pip install --upgrade pip wheel setuptools virtualenv asv wget cmake casadi numpy
21+
- name: Install SuiteSparse and Sundials
22+
run: python scripts/install_KLU_Sundials.py
1623
- name: Fetch base branch
1724
run: |
1825
# This workflow also runs for merge commits
@@ -22,6 +29,7 @@ jobs:
2229
if [ $current_branch != "develop" ]; then
2330
git fetch origin develop:develop
2431
fi
32+
2533
- name: Run benchmarks
2634
run: |
2735
asv machine --machine "GitHubRunner"
@@ -30,7 +38,7 @@ jobs:
3038
HEAD_COMMIT=$(git rev-parse HEAD)
3139
echo $BASE_COMMIT | tee commits_to_compare.txt
3240
echo $HEAD_COMMIT | tee -a commits_to_compare.txt
33-
asv run HASHFILE:commits_to_compare.txt --m "GitHubRunner" --show-stderr
41+
asv run HASHFILE:commits_to_compare.txt --m "GitHubRunner" --show-stderr -v
3442
- name: Compare commits' benchmark results
3543
run: |
3644
BASE_COMMIT=$(head -1 commits_to_compare.txt)

.github/workflows/test_on_push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636

3737
- name: Check style
3838
run: |
39-
python -m pip install "tox<4"
40-
tox -e flake8
39+
python -m pip install pre-commit
40+
pre-commit run ruff
4141
4242
build:
4343
needs: style

.github/workflows/url_checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v3
1515
- name: URLs-checker
16-
uses: urlstechie/urlchecker-action@0.0.31
16+
uses: urlstechie/urlchecker-action@master
1717
with:
1818
# A comma-separated list of file types to cover in the URL checks
1919
file_types: .rst,.md,.py,.ipynb

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*.DS_Store
77
*.mat
88
*.csv
9+
*.hidden
910

1011
# don't ignore important .txt and .csv files
1112
!requirements*
@@ -61,9 +62,6 @@ dist/
6162
coverage.xml
6263
htmlcov/
6364

64-
# black setup file seems to make Travis CI fail
65-
pyproject.toml
66-
6765
# virtual enviroment
6866
env/
6967
venv/

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ repos:
1010
exclude: assets/js/webapp\.js
1111

1212
- repo: https://github.com/psf/black
13-
rev: 22.12.0
13+
rev: 23.1.0
1414
hooks:
1515
- id: black
1616

17-
- repo: https://github.com/PyCQA/flake8
18-
rev: 6.0.0
17+
- repo: https://github.com/charliermarsh/ruff-pre-commit
18+
rev: "v0.0.246"
1919
hooks:
20-
- id: flake8
20+
- id: ruff
21+
args: [--ignore=E741, --exclude=__init__.py]

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,26 @@
33
## Features
44

55
- Added temperature control to experiment class. ([#2518])(https://github.com/pybamm-team/PyBaMM/pull/2518)
6+
- The "particle size" option can now be a tuple to allow different behaviour in each electrode([#2672](https://github.com/pybamm-team/PyBaMM/pull/2672)).
7+
8+
## Bug fixes
9+
10+
- Fixed the length scaling for the first dimension of r-R plots ([#2663](https://github.com/pybamm-team/PyBaMM/pull/2663)).
11+
12+
# [v23.1](https://github.com/pybamm-team/PyBaMM/tree/v23.1) - 2023-01-31
13+
14+
## Features
15+
16+
- Changed linting from `flake8` to `ruff` ([#2630](https://github.com/pybamm-team/PyBaMM/pull/2630)).
17+
- Changed docs theme to pydata theme and start to improve docs in general ([#2618](https://github.com/pybamm-team/PyBaMM/pull/2618)).
18+
- New `contact resistance` option, new parameter `Contact resistance [Ohm]` and new variable `Contact overpotential [V]` ([#2598](https://github.com/pybamm-team/PyBaMM/pull/2598)).
619
- Steps in `Experiment` can now be tagged and cycle numbers be searched based on those tags ([#2593](https://github.com/pybamm-team/PyBaMM/pull/2593)).
720

21+
## Bug fixes
22+
23+
- Fixed a bug where the solid phase conductivity was double-corrected for tortuosity when loading parameters from a BPX file ([#2638](https://github.com/pybamm-team/PyBaMM/pull/2638)).
24+
- Changed termination from "success" to "final time" for algebraic solvers to match ODE/DAE solvers ([#2613](https://github.com/pybamm-team/PyBaMM/pull/2613)).
25+
826
# [v22.12](https://github.com/pybamm-team/PyBaMM/tree/v22.12) - 2022-12-31
927

1028
## Features

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ keywords:
2424
- "expression tree"
2525
- "python"
2626
- "symbolic differentiation"
27-
version: "22.12"
27+
version: "23.1"
2828
repository-code: "https://github.com/pybamm-team/PyBaMM"
2929
title: "Python Battery Mathematical Modelling (PyBaMM)"

CONTRIBUTING.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,18 @@ Finally, if you really, really, _really_ love developing PyBaMM, have a look at
6363

6464
PyBaMM follows the [PEP8 recommendations](https://www.python.org/dev/peps/pep-0008/) for coding style. These are very common guidelines, and community tools have been developed to check how well projects implement them. We recommend using pre-commit hooks to check your code before committing it. See [installing and using pre-commit](https://github.com/pybamm-team/PyBaMM/blob/develop/CONTRIBUTING.md#installing-and-using-pre-commit) section for more details.
6565

66-
### Flake8
66+
### Ruff
6767

68-
We use [flake8](http://flake8.pycqa.org/en/latest/) to check our PEP8 adherence. To try this on your system, navigate to the PyBaMM directory in a console and type
68+
We use [ruff](https://github.com/charliermarsh/ruff) to check our PEP8 adherence. To try this on your system, navigate to the PyBaMM directory in a console and type
6969

7070
```bash
71-
flake8
71+
python -m pip install pre-commit
72+
pre-commit run ruff
7273
```
7374

74-
Flake8 is configured inside the file `tox.ini`, under the section `[flake8]`, allowing us to ignore some errors. If you think this should be added or removed, please submit an [issue](#issues)
75+
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)
7576

76-
When you commit your changes they will be checked against flake8 automatically (see [infrastructure](#infrastructure)).
77+
When you commit your changes they will be checked against ruff automatically (see [infrastructure](#infrastructure)).
7778

7879
### Black
7980

@@ -89,7 +90,7 @@ black {source_file_or_directory}
8990

9091
If you want to use black in your editor, you may need to change the max line length in your editor settings.
9192

92-
Even when code has been formatted by black, you should still make sure that it adheres to the PEP8 standard set by [Flake8](#flake8).
93+
Even when code has been formatted by black, you should still make sure that it adheres to the PEP8 standard set by [ruff](#ruff).
9394

9495
### Naming
9596

@@ -111,7 +112,7 @@ On the other hand... We _do_ want to compare several tools, to generate document
111112
1. Core PyBaMM: A minimal set, including things like NumPy, SciPy, etc. All infrastructure should run against this set of dependencies, as well as any numerical methods we implement ourselves.
112113
2. Extras: Other inference packages and their dependencies. Methods we don't want to implement ourselves, but do want to provide an interface to can have their dependencies added here.
113114
3. Documentation generating code: Everything you need to generate and work on the docs.
114-
4. Development code: Everything you need to do PyBaMM development (so all of the above packages, plus flake8 and other testing tools).
115+
4. Development code: Everything you need to do PyBaMM development (so all of the above packages, plus ruff and other testing tools).
115116

116117
Only 'core pybamm' is installed by default. The others have to be specified explicitly when running the installation command.
117118

0 commit comments

Comments
 (0)