Skip to content

Commit

Permalink
Merge pull request #1258 from pybamm-team/release-0.3.0
Browse files Browse the repository at this point in the history
Fix graphviz version for windows
  • Loading branch information
valentinsulzer authored Nov 23, 2020
2 parents c6c07f0 + 76e45e8 commit 20fb565
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install Windows system dependencies
if: matrix.os == 'windows-latest'
run: choco install graphviz
run: choco install graphviz --version=2.38.0.20190211

- name: Install standard python dependencies
run: |
Expand Down
19 changes: 19 additions & 0 deletions pybamm/CITATIONS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@
note = {\href{ http://dx.doi.org/10.1149/1.2221597}{doi: 10.1149/1.2221597}},
}

@Article{harris2020array,
title={Array programming with NumPy},
author={Harris, Charles R and Millman, K Jarrod and van der Walt, St{'e}fan J and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J and others},
journal={Nature},
volume={585},
number={7825},
pages={357--362},
year={2020},
publisher={Nature Publishing Group}
}

@techreport{hindmarsh2000pvode,
title={The {PVODE} and {IDA} algorithms},
author={Hindmarsh, AC},
Expand All @@ -55,6 +66,14 @@
publisher={ACM New York, NY, USA}
}

@software{jax2018github,
author = {James Bradbury and Roy Frostig and Peter Hawkins and Matthew James Johnson and Chris Leary and Dougal Maclaurin and Skye Wanderman-Milne},
title = {{JAX}: composable transformations of {P}ython+{N}um{P}y programs},
url = {http://github.com/google/jax},
version = {0.2.5},
year = {2018},
}

@article{kim2011multi,
title={Multi-domain modeling of lithium-ion batteries encompassing multi-physics in varied length scales},
author={Kim, Gi-Heon and Smith, Kandler and Lee, Kyu-Jin and Santhanagopalan, Shriram and Pesaran, Ahmad},
Expand Down
3 changes: 2 additions & 1 deletion pybamm/citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ def _reset(self):
"Reset citations to default only (only for testing purposes)"
# Initialize empty papers to cite
self._papers_to_cite = set()
# Register the PyBaMM paper
# Register the PyBaMM paper and the numpy paper
self.register("sulzer2020python")
self.register("harris2020array")

def read_citations(self):
"Read the citations text file"
Expand Down
1 change: 1 addition & 0 deletions pybamm/solvers/jax_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __init__(
self.extra_options = extra_options or {}
self.name = "JAX solver ({})".format(method)
self._cached_solves = dict()
pybamm.citations.register("jax2018github")

def get_solve(self, model, t_eval):
"""
Expand Down
11 changes: 10 additions & 1 deletion tests/unit/test_citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
#
import pybamm
import unittest
from platform import system


class TestCitations(unittest.TestCase):
def test_citations(self):
citations = pybamm.citations
citations._reset()
# Default papers should be in both _all_citations dict and in the papers to cite
self.assertIn("sulzer2020python", citations._all_citations.keys())
self.assertIn("sulzer2020python", citations._papers_to_cite)
self.assertIn("harris2020array", citations._papers_to_cite)
# Non-default papers should only be in the _all_citations dict
self.assertIn("sulzer2019physical", citations._all_citations.keys())
self.assertNotIn("sulzer2019physical", citations._papers_to_cite)
Expand Down Expand Up @@ -180,6 +181,14 @@ def test_solver_citations(self):
pybamm.IDAKLUSolver()
self.assertIn("hindmarsh2005sundials", citations._papers_to_cite)

@unittest.skipIf(system() == "Windows", "JAX not supported on windows")
def test_jax_citations(self):
citations = pybamm.citations
citations._reset()
self.assertNotIn("jax2018github", citations._papers_to_cite)
pybamm.JaxSolver()
self.assertIn("jax2018github", citations._papers_to_cite)


if __name__ == "__main__":
print("Add -v for more debug output")
Expand Down

0 comments on commit 20fb565

Please sign in to comment.