Skip to content

Commit

Permalink
Merge branch 'master' into issue-729-add-ecker-parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Scottmar93 committed Feb 19, 2020
2 parents 3e1f8e4 + 084d8e4 commit 04da9c7
Show file tree
Hide file tree
Showing 145 changed files with 2,896 additions and 1,024 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
/local/
*.DS_Store
*.mat
*.csv

# don't ignore important .txt files
# don't ignore important .txt and .csv files
!requirements*
!LICENSE.txt
!CMakeLists.txt
!input/**/*.csv

# running files
*.pyc
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ matrix:
env:
- PYTHON=3.7.4
- PYBAMM_UNIT=true
- PYBAMM_KLU=true
if: type != cron
- python: "3.7"
addons:
Expand Down Expand Up @@ -177,6 +178,8 @@ before_install: |
brew update;
# Per the `pyenv homebrew recommendations <https://github.com/yyuu/pyenv/wiki#suggested-build-environment>`_.
brew install graphviz openssl readline;
# Other brew packages
brew install gcc cmake openblas suitesparse;
# See https://docs.travis-ci.com/user/osx-ci-environment/#A-note-on-upgrading-packages.
brew outdated pyenv || brew upgrade pyenv
# virtualenv doesn't work without pyenv knowledge. venv in Python 3.3
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@

## Features

- Added NCA parameter set ([#824](https://github.com/pybamm-team/PyBaMM/pull/824))
- Added functionality to `Solution` that automatically gets `t_eval` from the data when simulating drive cycles and performs checks to ensure the output has the required resolution to accurately capture the input current ([#819](https://github.com/pybamm-team/PyBaMM/pull/819))
- Added options to export a solution to matlab or csv ([#811](https://github.com/pybamm-team/PyBaMM/pull/811))
- Allow porosity to vary in space ([#809](https://github.com/pybamm-team/PyBaMM/pull/809))
- Added functionality to solve DAE models with non-smooth current inputs ([#808](https://github.com/pybamm-team/PyBaMM/pull/808))
- Added functionality to simulate experiments and testing protocols ([#807](https://github.com/pybamm-team/PyBaMM/pull/807))
- Added fuzzy string matching for parameters and variables ([#796](https://github.com/pybamm-team/PyBaMM/pull/796))
- Changed ParameterValues to raise an error when a parameter that wasn't previously defined is updated ([#796](https://github.com/pybamm-team/PyBaMM/pull/796))
- Added some basic models (BasicSPM and BasicDFN) in order to clearly demonstrate the PyBaMM model structure for battery models ([#795](https://github.com/pybamm-team/PyBaMM/pull/795))
- Allow initial conditions in the particle to depend on x ([#786](https://github.com/pybamm-team/PyBaMM/pull/786))
- Added the harmonic mean to the Finite Volume method, which is now used when computing fluxes ([#783](https://github.com/pybamm-team/PyBaMM/pull/783))
- Refactored `Solution` to make it a dictionary that contains all of the solution variables. This automatically creates `ProcessedVariable` objects when required, so that the solution can be obtained much more easily. ([#781](https://github.com/pybamm-team/PyBaMM/pull/781))
- Added notebook to explain broadcasts ([#776](https://github.com/pybamm-team/PyBaMM/pull/776))
Expand Down Expand Up @@ -46,6 +53,9 @@

## Bug fixes

- Time for solver should now be given in seconds ([#832](https://github.com/pybamm-team/PyBaMM/pull/832))
- Fixed a bug where the first line of the data wasn't loaded when parameters are loaded from data ([#819](https://github.com/pybamm-team/PyBaMM/pull/819))
- Made `graphviz` an optional dependency ([#810](https://github.com/pybamm-team/PyBaMM/pull/810))
- Fixed examples to run with basic pip installation ([#800](https://github.com/pybamm-team/PyBaMM/pull/800))
- Added events for CasADi solver when stepping ([#800](https://github.com/pybamm-team/PyBaMM/pull/800))
- Improved implementation of broadcasts ([#776](https://github.com/pybamm-team/PyBaMM/pull/776))
Expand All @@ -59,10 +69,13 @@
- Added missing temperature dependence in electrolyte and interface submodels ([#698](https://github.com/pybamm-team/PyBaMM/pull/698))
- Fixed differentiation of functions that have more than one argument ([#687](https://github.com/pybamm-team/PyBaMM/pull/687))
- Added warning if `ProcessedVariable` is called outside its interpolation range ([#681](https://github.com/pybamm-team/PyBaMM/pull/681))
- Updated installation instructions for Mac OS ([#680](https://github.com/pybamm-team/PyBaMM/pull/680))
- Improved the way `ProcessedVariable` objects are created in higher dimensions ([#581](https://github.com/pybamm-team/PyBaMM/pull/581))

## Breaking changes

- Model events are now represented as a list of `pybamm.Event` ([#759](https://github.com/pybamm-team/PyBaMM/issues/759)
- Removed `ParameterValues.update_model`, whose functionality is now replaced by `InputParameter` ([#801](https://github.com/pybamm-team/PyBaMM/pull/801))
- Removed `Outer` and `Kron` nodes as no longer used ([#777](https://github.com/pybamm-team/PyBaMM/pull/777))
- Moved `results` to separate repositories ([#761](https://github.com/pybamm-team/PyBaMM/pull/761))
- The parameters "Bruggeman coefficient" must now be specified separately as "Bruggeman coefficient (electrolyte)" and "Bruggeman coefficient (electrode)"
Expand Down
57 changes: 32 additions & 25 deletions INSTALL-LINUX.md → INSTALL-LINUX-MAC.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Prerequisites

To use and/or contribute to PyBaMM, you must have Python 3.6 or above installed.
To use and/or contribute to PyBaMM, you must have Python 3.6 or 3.7 installed (note that 3.8 is not yet supported).

To install Python 3 on Debian-based distribution (Debian, Ubuntu, Linux mint), open a terminal and run
```bash
sudo apt update
Expand All @@ -10,6 +11,18 @@ On Fedora or CentOS, you can use DNF or Yum. For example
```bash
sudo dnf install python3
```
On Mac OS distributions, you can use `homebrew`.
First [install `brew`](https://docs.python-guide.org/starting/install3/osx/):

```bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

then follow instructions in link on adding brew to path, and run

```bash
brew install python3
```

## Install PyBaMM

Expand Down Expand Up @@ -39,38 +52,34 @@ PyBaMM can be installed via pip:
pip install pybamm
```

PyBaMM's dependencies (such as `numpy`, `scipy`, etc) will be installed automatically when you install PyBaMM using `pip`.

PyBaMM has the following python libraries as dependencies: `numpy`, `scipy`, `pandas`,
`matplotlib`. These will be installed automatically when you install PyBaMM using `pip`,
following the instructions below. First, make sure you have activated your virtual
environment as above, and that you have the latest version of pip installed:
For an introduction to virtual environments, see (https://realpython.com/python-virtual-environments-a-primer/).

### Developer install

Then navigate to the path where you downloaded PyBaMM to (you will already be in the
correct location if you followed the instructions above), and install both PyBaMM and
its dependencies by typing:
If you wish to contribute to PyBaMM, you should get the latest version from the GitHub repository.
To do so, you must have Git and graphviz installed. For instance run

```bash
pip install pybamm
sudo apt install git graphviz
```
For an introduction to virtual environments, see (https://realpython.com/python-virtual-environments-a-primer/).

### developer install
on Debian-based distributions, or

If you wish to contribute to PyBaMM, you should get the latest version from the GitHub repository.
To do so, you must have Git installed.
For instance run
```bash
sudo apt install git
brew install git graphviz
```
on Debian-based distributions.

on Mac OS.

To install PyBaMM, the first step is to get the code by cloning this repository

```bash
git clone https://github.com/pybamm-team/PyBaMM.git
cd PyBaMM
```
Then, install PyBaMM as a develop per with [developer](CONTRIBUTING.md), use
Then, to install PyBaMM as a [developer](CONTRIBUTING.md), type

```bash
pip install -e .[dev,docs]
Expand Down Expand Up @@ -100,10 +109,10 @@ This can be done using `git`, running
git clone https://github.com/pybamm-team/PyBaMM.git
cd PyBaMM
```
Alternatively, you can dowload the source code archive from [the PyBaMM GitHub repo](https://github.com/pybamm-team/PyBaMM.git) and extract it the location of your choice.
Alternatively, you can download the source code archive from [the PyBaMM GitHub repo](https://github.com/pybamm-team/PyBaMM.git) and extract it to the location of your choice.

Ideally you should have the python package `wget` installed.
This allows for the automatic download of some of the dependencies has part of the installation process.
This allows for the automatic download of some of the dependencies that are part of the installation process.
You can install it using (within your virtual environment)
```bash
pip install wget
Expand All @@ -113,7 +122,6 @@ pip install wget
Users can install [scikits.odes](https://github.com/bmcage/odes) in order to use the
wrapped SUNDIALS ODE and DAE
[solvers](https://pybamm.readthedocs.io/en/latest/source/solvers/scikits_solvers.html).
The Sundials DAE solver is required to solve the DFN battery model in PyBaMM.

Before installing scikits.odes, you need to have installed:

Expand All @@ -139,15 +147,15 @@ Alternatively, you can specify a directory containing the source code of the Sun
```bash
python setup.py install_odes --sundials-src=<path/to/sundials/source>
```
By default, the sundials are installed in a `sundials` directory located at the root of the PyBaMM package.
By default, sundials is installed in a `sundials` directory located at the root of the PyBaMM package.
You can provide another location by using the `--sundials-inst=<path/to/other/location>` option.

If you are installing `scikits.odes` within a virtual environment, the `activate` script will be automatically
updated to add the sundials installation directory to your `LD_LIBRARY_PATH`.
This is required in order to use `scikits.odes`.
As a consequence, after installation you should restart your virtual environment.

If you wish to install the scikits.odes outside of a virtual environment, your `.bashrc` will be modified instead.
If you wish to install `scikits.odes` outside of a virtual environment, your `.bashrc` will be modified instead.
After installation you should therefore run
```bash
source ~/.bashrc
Expand All @@ -166,7 +174,7 @@ sparse solver.
PyBaMM currently offers a direct interface to the sparse KLU solver within Sundials.
#### Prerequisites
The requirements are the same than for the installation of `scikits.odes` (see previous section).
The requirements are the same as for the installation of `scikits.odes` (see previous section).
Additionally, the [pybind11 GitHub repository](https://github.com/pybind/pybind11.git) should be located in `PyBaMM/third-party/`.
First create a directory `third-party` and clone the repository:
```bash
Expand Down Expand Up @@ -198,14 +206,13 @@ python -c "import pybamm; print(pybamm.have_idaklu())
```
### Install everything
It is possible to install both `scikits.odes` and KLU solver using the command
It is possible to install both `scikits.odes` and the KLU solver using the command
```bash
python setup.py install_all
```
Note that options `--sundials-src`, `--sundials-inst` and `suitesparse-src` are still usable
here.
You can make sure the install was successful by runing
Finally, you can check your install by running
```bash
python -c "import pybamm; print(pybamm.have_scikits_odes())
Expand Down
8 changes: 4 additions & 4 deletions INSTALL-WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To download the PyBaMM source code, you first need to install git, which you can
typing

```bash
$ sudo apt install git-core
sudo apt install git-core
```

For easier integration with WSL, we recommend that you install PyBaMM in your *Windows*
Expand All @@ -31,21 +31,21 @@ $ cd /mnt/c/Users/USER_NAME/Documents
where USER_NAME is your username. Exact path to Windows documents may vary. Now use git to clone the PyBaMM repository:

```bash
$ git clone https://github.com/pybamm-team/PyBaMM.git
git clone https://github.com/pybamm-team/PyBaMM.git
```

This will create a new directly called `PyBaMM`, you can move to this directory in bash
using the `cd` command:

```bash
$ cd PyBaMM
cd PyBaMM
```

If you are unfamiliar with the linux command line, you might find it useful to work through this
[tutorial](https://tutorials.ubuntu.com/tutorial/command-line-for-beginners) provided by Ubuntu.

Now head over and follow the installation instructions for PyBaMM for linux
[here](INSTALL-LINUX.md).
[here](INSTALL-LINUX-MAC.md).

## Use Visual Studio Code to run PyBaMM

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ For further examples, see the list of repositories that use PyBaMM [here](https:

### Linux

For instructions on installing PyBaMM on Debian-based distributions, please see [here](INSTALL-LINUX.md)
For instructions on installing PyBaMM on Debian-based distributions, please see [here](INSTALL-LINUX-MAC.md)

### Mac OS

For instructions on installing PyBaMM on Mac OS distributions, please see [here](INSTALL-LINUX-MAC.md)

### Windows

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Contents
source/meshes/index
source/spatial_methods/index
source/solvers/index
source/experiments/index
source/processed_variable
source/util
source/simulation
Expand Down
5 changes: 5 additions & 0 deletions docs/source/experiments/experiment.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Base Experiment Class
=====================

.. autoclass:: pybamm.Experiment
:members:
8 changes: 8 additions & 0 deletions docs/source/experiments/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Experiments
===========

Classes to help set operating conditions for some standard battery modelling experiments

.. toctree::

experiment

This file was deleted.

1 change: 0 additions & 1 deletion docs/source/models/submodels/particle/fickian/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Fickian

.. toctree::

base_fickian_particle
fickian_many_particles
fickian_single_particle

3 changes: 3 additions & 0 deletions docs/source/solvers/solution.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Solution
========

.. autoclass:: pybamm._BaseSolution
:members:

.. autoclass:: pybamm.Solution
:members:
Loading

0 comments on commit 04da9c7

Please sign in to comment.