From 6f00fc8cec9da4129bff621e9ff7280642be862f Mon Sep 17 00:00:00 2001 From: tinosulzer Date: Sun, 27 Oct 2019 23:47:09 -0400 Subject: [PATCH] #646 split up instructions and make clearer what is optional --- INSTALL-LINUX-MAC.md | 186 +----------------- INSTALL-SCIKITS.md | 106 ++++++++++ INSTALL-WINDOWS.md | 6 +- INSTALL_KLU.md | 161 +++++++++++++++ .../full_battery_models/lead_acid/full.py | 5 +- .../lead_acid/higher_order.py | 5 +- .../full_battery_models/lithium_ion/dfn.py | 6 +- pybamm/solvers/scikits_ode_solver.py | 2 +- .../test_asymptotics_convergence.py | 2 +- .../test_lead_acid/test_compare_outputs.py | 2 +- .../test_lead_acid/test_composite.py | 2 +- .../test_lead_acid/test_foqs.py | 2 +- .../test_lead_acid/test_full.py | 10 +- .../test_composite_side_reactions.py | 2 +- .../test_full_side_reactions.py | 4 +- .../test_loqs_side_reactions.py | 2 +- .../test_lithium_ion/test_dfn.py | 6 +- .../test_lithium_ion/test_spm.py | 4 +- .../test_lithium_ion/test_spme.py | 4 +- tests/integration/test_quick_plot.py | 4 +- .../test_lead_acid/test_composite.py | 4 +- .../test_lead_acid/test_full.py | 4 +- .../test_lead_acid/test_loqs.py | 2 +- .../test_lithium_ion/test_dfn.py | 12 +- .../test_lithium_ion/test_spm.py | 12 +- .../test_lithium_ion/test_spme.py | 12 +- .../unit/test_solvers/test_scikits_solvers.py | 2 +- 27 files changed, 333 insertions(+), 236 deletions(-) create mode 100644 INSTALL-SCIKITS.md create mode 100644 INSTALL_KLU.md diff --git a/INSTALL-LINUX-MAC.md b/INSTALL-LINUX-MAC.md index 65d4c86d87..c391c2ffce 100644 --- a/INSTALL-LINUX-MAC.md +++ b/INSTALL-LINUX-MAC.md @@ -97,195 +97,17 @@ pip uninstall pybamm ## Optional dependencies -### [scikits.odes](https://github.com/bmcage/odes) - -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: - -- Python header files (`python-dev/python3-dev` on Debian/Ubuntu-based distributions, comes with python3 by default in brew) -- C compiler -- Fortran compiler (e.g. gfortran, comes with gcc in brew) -- BLAS/LAPACK install (OpenBLAS is recommended by the scikits.odes developers) -- CMake (for building Sundials) -- Sundials 3.1.1 (see instructions below) - -You can install these on Ubuntu or Debian using apt-get: - -```bash -sudo apt-get install python3-dev gfortran gcc cmake libopenblas-dev -``` - -or on a Mac OS distribution using brew: - -```bash -brew install gcc cmake openblas -``` - -To install Sundials 3.1.1, on the command-line type: - -```bash -INSTALL_DIR=`pwd`/sundials -wget https://computation.llnl.gov/projects/sundials/download/sundials-3.1.1.tar.gz -tar -xvf sundials-3.1.1.tar.gz -mkdir build-sundials-3.1.1 -cd build-sundials-3.1.1/ -cmake -DLAPACK_ENABLE=ON -DSUNDIALS_INDEX_TYPE=int32_t -DBUILD_ARKODE:BOOL=OFF -DEXAMPLES_ENABLE:BOOL=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR ../sundials-3.1.1/ -make install -rm -r ../sundials-3.1.1 -``` - -Then install [scikits.odes](https://github.com/bmcage/odes), letting it know the sundials install location: - -```bash -SUNDIALS_INST=$INSTALL_DIR pip install scikits.odes -``` - -After this, you will need to set your `LD_LIBRARY_PATH` (for Linux) or `DYLD_LIBRARY_PATH` (for Mac) to point to the sundials -library - for Linux: - -```bash -export LD_LIBRARY_PATH=$INSTALL_DIR/lib:$LD_LIBRARY_PATH -``` - -or for Mac: - -```bash -export DYLD_LIBRARY_PATH=$INSTALL_DIR/lib:$DYLD_LIBRARY_PATH -``` +Two DAE solvers (`scikits.odes` and `KLU`) can be optionally installed in PyBaMM. At least one of these is required to solve DAE models, such as the DFN, but you can install both if you like. -You may wish to put one of these lines in your `.bashrc` or virtualenv `activate` script, -which will save you needing to set your `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` every time you log in. For -example, to add this line to your `.bashrc` you can type: - -```bash -echo "export LD_LIBRARY_PATH=$INSTALL_DIR/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc -``` +### [scikits.odes](https://github.com/bmcage/odes) -Please see the [scikits.odes -documentation](https://scikits-odes.readthedocs.io/en/latest/installation.html) for more -detailed installation instructions. +A python wrapper for the SUNDIALS ODE and DAE integrators. [Installation instructions](INSTALL-SCIKITS.md). ### Sundials with KLU sparse solver If you wish so simulate large systems such as the 2+1D models, we recommend employing a sparse solver. PyBaMM currently offers a direct interface to the sparse KLU solver within Sundials. -If you are on a linux based distribution, a bash script has been provided which should -install everything for you correctly. Please note you will require the python header files, openblas, -a c compiler (e.g. gcc), cmake, and suitesparse all of which you should be able to install, either on ubuntu using - -```bash -apt install python3-dev libopenblas-dev cmake gcc libsuitesparse-dev -``` - -or on a Mac OS distribution using brew (`python3-dev` is installed by `python3`): - -```bash -brew install gcc cmake openblas suitesparse -``` - -You will likely need to prepend `sudo` to the above command. - -To install sundials with KLU, from within the main PyBaMM directory type - -```bash -./scripts/install_sundials_4.1.0.sh -``` - -Note that this script has only been tested on Ubuntu 18.04.3 LTS. If this script does not work for you, you can try following the step-by-step instructions below: - -#### Download and build Sundials 4.1.0 - -The KLU solver is interfaced using an updated version of Sundials so even if you have installed Sundials for use with Scikits.odes, you still need to install sundials here. If you want more information on the sundials installation please refer to the the ida_guide.pdf available at on the [sundials site](https://computing.llnl.gov/projects/sundials/sundials-software) - -First, download Sundials 4.1.0 using - -```bash -wget https://computing.llnl.gov/projects/sundials/download/sundials-4.1.0.tar.gz -O sundials-4.1.0.tar.gz -tar -xvf sundials-4.1.0.tar.gz -rm sundials-4.1.0.tar.gz -``` - -The cmake instructions provided with Sundials have trouble linking the required libraries related to the KLU solver, therefore we have provided a modified `CMakeLists.txt` file which fixes this. Copy this across into the sundials-4.1.0 folder, overwriting the old file, using - -```bash -cp scripts/replace-cmake/CMakeLists.txt sundials-4.1.0/CMakeLists.txt -``` - -Now create a directory to build sundials in and set the install directory for sundials: - -```bash -mkdir build-sundials-4.1.0 -INSTALL_DIR=`pwd`/sundials4 -``` - -Now enter the build directory, use cmake to generate the appropriate make files, and then build sundials and install sundials into the install directory using make: - -```bash -cd build-sundials-4.1.0 -cmake -DBLAS_ENABLE=ON\ - -DLAPACK_ENABLE=ON\ - -DSUNDIALS_INDEX_SIZE=32\ - -DBUILD_ARKODE=OFF\ - -DBUILD_CVODE=OFF\ - -DBUILD_CVODES=OFF\ - -DBUILD_IDAS=OFF\ - -DBUILD_KINSOL=OFF\ - -DEXAMPLES_ENABLE:BOOL=OFF\ - -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR\ - -DKLU_ENABLE=ON\ - ../sundials-4.1.0 -make install -``` - -Now return to your PyBaMM home directory and remove the build-sundials-4.1.0 folder and the download folder: - -```bash -cd .. -rm -rf build-sundials-4.1.0 -rm -rf sundials-4.1.0 -``` - -#### Install pybind11 -To interface with Sundials which is written in C, we require pybind11. Clone the pybind11 repository whilst within a folder the third-party folder: - -```bash -mkdir third-party -cd third-party -git clone https://github.com/pybind/pybind11.git -cd .. -``` - -You will also require pybind11 to be pip installed so from within your virtual enviroment (if you are using one) type: - -```bash -pip install pybind11 -``` - -#### Build the KLU wrapper -We now have all the tools to build a shared library to interface to the KLU solver. Within your PyBaMM home directory build the required Makefile using - -```bash -cmake . -``` - -This will automatically find the headers for the latest version of python installed on your machine. If you are using an older version (e.g python3.6) within your virtual environment, then you instead can use `cmake -DPYBIND11_PYTHON_VERSION=3.6 .`. - -You can now simply run make to build the library (you can just run this command if you make some changes to klu.cpp) - -```bash -make -``` - -To clean up you directory you can now remove the automatically generated cmake files: -``` -rm -rf CMakeFiles -rm CMakeCache.txt -rm cmake_install.cmake -``` +[Installation instructions](INSTALL-KLU.md). ## Troubleshooting diff --git a/INSTALL-SCIKITS.md b/INSTALL-SCIKITS.md new file mode 100644 index 0000000000..b0b800e219 --- /dev/null +++ b/INSTALL-SCIKITS.md @@ -0,0 +1,106 @@ +# Install scikits.odes + +--- +**Note** + +This file provides installation instructions for either Ubuntu-based distributions or Mac OS distributions. Please read carefully which lines to run in each case. + +--- + + +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: + +- Python header files (`python-dev/python3-dev` on Debian/Ubuntu-based distributions, comes with python3 by default in brew) +- C compiler +- Fortran compiler (e.g. gfortran, comes with gcc in brew) +- BLAS/LAPACK install (OpenBLAS is recommended by the scikits.odes developers) +- CMake (for building Sundials) +- Sundials 3.1.1 (see instructions below) + +You can install these on Ubuntu or Debian using apt-get: + +```bash +sudo apt-get install python3-dev gfortran gcc cmake libopenblas-dev +``` + +or on a Mac OS distribution using brew: + +```bash +brew install wget gcc cmake openblas +``` + +## Installing SUNDIALS and scikits.odes + +### Option 1: install with script + +We recommend that you first try to install SUNDIALS and scikits together by running the script + +```bash +source scripts/install_scikits_odes.sh +``` + +If this works, skip to [the final section](#setting-library-path). Otherwise, try Option 2 below. + +## Option 2: install manually + + +To install SUNDIALS 3.1.1 manually, on the command-line type: + +```bash +INSTALL_DIR=`pwd`/sundials +wget https://computation.llnl.gov/projects/sundials/download/sundials-3.1.1.tar.gz +tar -xvf sundials-3.1.1.tar.gz +mkdir build-sundials-3.1.1 +cd build-sundials-3.1.1/ +cmake -DLAPACK_ENABLE=ON -DSUNDIALS_INDEX_TYPE=int32_t -DBUILD_ARKODE:BOOL=OFF -DEXAMPLES_ENABLE:BOOL=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR ../sundials-3.1.1/ +make install +rm -r ../sundials-3.1.1 +``` + +Then install [scikits.odes](https://github.com/bmcage/odes), letting it know the sundials install location: + +```bash +SUNDIALS_INST=$INSTALL_DIR pip install scikits.odes +``` + +## Setting library path + +After this, you will need to set your `LD_LIBRARY_PATH` (for Linux) or `DYLD_LIBRARY_PATH` (for Mac) to point to the sundials +library - for Linux: + +```bash +export LD_LIBRARY_PATH=$INSTALL_DIR/lib:$LD_LIBRARY_PATH +``` + +or for Mac: + +```bash +export DYLD_LIBRARY_PATH=$INSTALL_DIR/lib:$DYLD_LIBRARY_PATH +``` + +You may wish to put one of these lines in your `.bashrc` or virtualenv `activate` script, +which will save you needing to set your `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` every time you log in. For +example, to add this line to your virtual environment `env` you can type: + +```bash +echo "export LD_LIBRARY_PATH=$INSTALL_DIR/lib:\$LD_LIBRARY_PATH" >> env/bin/activate +``` + +for Linux or + +```bash +echo "export DYLD_LIBRARY_PATH=$INSTALL_DIR/lib:\$DYLD_LIBRARY_PATH" >> env/bin/activate +``` + +for Mac. + +Please see the [scikits.odes +documentation](https://scikits-odes.readthedocs.io/en/latest/installation.html) for more +detailed installation instructions. + +You can also try installing the [KLU solver](INSTALL-KLU.md) if you haven't already done so, but you only need one DAE solver. \ No newline at end of file diff --git a/INSTALL-WINDOWS.md b/INSTALL-WINDOWS.md index abd2c3968d..47c425bd8c 100644 --- a/INSTALL-WINDOWS.md +++ b/INSTALL-WINDOWS.md @@ -18,20 +18,20 @@ 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 ``` 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 diff --git a/INSTALL_KLU.md b/INSTALL_KLU.md new file mode 100644 index 0000000000..fb7e37fc91 --- /dev/null +++ b/INSTALL_KLU.md @@ -0,0 +1,161 @@ +# Install IDA-KLU Solver + +--- +**Note** + +This file provides installation instructions for either Ubuntu-based distributions or Mac OS distributions. Please read carefully which lines to run in each case. + +--- + +If you are on a linux based distribution, a bash script has been provided which should +install everything for you correctly. Please note you will require the python header files, openblas, +a c compiler (e.g. gcc), cmake, and suitesparse all of which you should be able to install, either on ubuntu using + +```bash +apt install python3-dev libopenblas-dev cmake gcc libsuitesparse-dev +``` + +or on a Mac OS distribution using brew (`python3-dev` is installed by `python3`): + +```bash +brew install wget gcc cmake openblas suitesparse +``` + +You will likely need to prepend `sudo` to the above command. + +## Installing KLU + +### Option 1: install with script + +We recommend that you first try to install KLU by running the script. From within the main PyBaMM directory type + +```bash +source scripts/install_sundials_4.1.0.sh +``` + +Note that this script has only been tested on Ubuntu 18.04.3 LTS. If this works, skip to [the final section](#setting-library-path). Otherwise, try Option 2 below. If this script does not work for you, you can try following the step-by-step instructions below in Option 2. + +## Option 2: install manually + +#### Download and build Sundials 4.1.0 + +The KLU solver is interfaced using an updated version of Sundials so even if you have installed Sundials for use with Scikits.odes, you still need to install sundials here. If you want more information on the sundials installation please refer to the the ida_guide.pdf available at on the [sundials site](https://computing.llnl.gov/projects/sundials/sundials-software) + +First, download Sundials 4.1.0 using + +```bash +wget https://computing.llnl.gov/projects/sundials/download/sundials-4.1.0.tar.gz -O sundials-4.1.0.tar.gz +tar -xvf sundials-4.1.0.tar.gz +rm sundials-4.1.0.tar.gz +``` + +The cmake instructions provided with Sundials have trouble linking the required libraries related to the KLU solver, therefore we have provided a modified `CMakeLists.txt` file which fixes this. Copy this across into the sundials-4.1.0 folder, overwriting the old file, using + +```bash +cp scripts/replace-cmake/CMakeLists.txt sundials-4.1.0/CMakeLists.txt +``` + +Now create a directory to build sundials in and set the install directory for sundials: + +```bash +mkdir build-sundials-4.1.0 +INSTALL_DIR=`pwd`/sundials4 +``` + +Now enter the build directory, use cmake to generate the appropriate make files, and then build sundials and install sundials into the install directory using make: + +```bash +cd build-sundials-4.1.0 +cmake -DBLAS_ENABLE=ON\ + -DLAPACK_ENABLE=ON\ + -DSUNDIALS_INDEX_SIZE=32\ + -DBUILD_ARKODE=OFF\ + -DBUILD_CVODE=OFF\ + -DBUILD_CVODES=OFF\ + -DBUILD_IDAS=OFF\ + -DBUILD_KINSOL=OFF\ + -DEXAMPLES_ENABLE:BOOL=OFF\ + -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR\ + -DKLU_ENABLE=ON\ + ../sundials-4.1.0 +make install +``` + +Now return to your PyBaMM home directory and remove the build-sundials-4.1.0 folder and the download folder: + +```bash +cd .. +rm -rf build-sundials-4.1.0 +rm -rf sundials-4.1.0 +``` + +#### Install pybind11 +To interface with Sundials which is written in C, we require pybind11. Clone the pybind11 repository whilst within a folder the third-party folder: + +```bash +mkdir third-party +cd third-party +git clone https://github.com/pybind/pybind11.git +cd .. +``` + +You will also require pybind11 to be pip installed so from within your virtual enviroment (if you are using one) type: + +```bash +pip install pybind11 +``` + +#### Build the KLU wrapper +We now have all the tools to build a shared library to interface to the KLU solver. Within your PyBaMM home directory build the required Makefile using + +```bash +cmake . +``` + +This will automatically find the headers for the latest version of python installed on your machine. If you are using an older version (e.g python3.6) within your virtual environment, then you instead can use `cmake -DPYBIND11_PYTHON_VERSION=3.6 .`. + +You can now simply run make to build the library (you can just run this command if you make some changes to klu.cpp) + +```bash +make +``` + +To clean up you directory you can now remove the automatically generated cmake files: +``` +rm -rf CMakeFiles +rm CMakeCache.txt +rm cmake_install.cmake +``` + +## Setting library path + +After this, you will need to set your `LD_LIBRARY_PATH` (for Linux) or `DYLD_LIBRARY_PATH` (for Mac) to point to the sundials +library - for Linux: + +```bash +export LD_LIBRARY_PATH=$INSTALL_DIR/lib:$LD_LIBRARY_PATH +``` + +or for Mac: + +```bash +export DYLD_LIBRARY_PATH=$INSTALL_DIR/lib:$DYLD_LIBRARY_PATH +``` + +You may wish to put one of these lines in your `.bashrc` or virtualenv `activate` script, +which will save you needing to set your `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH` every time you log in. For +example, to add this line to your virtual environment `env` you can type: + +```bash +echo "export LD_LIBRARY_PATH=$INSTALL_DIR/lib:\$LD_LIBRARY_PATH" >> env/bin/activate +``` + +for Linux or + +```bash +echo "export DYLD_LIBRARY_PATH=$INSTALL_DIR/lib:\$DYLD_LIBRARY_PATH" >> env/bin/activate +``` + +for Mac. + +You can also try installing the [scikits.odes solver](INSTALL_SCIKITS.md) if you haven't already done so, but you only need one DAE solver. \ No newline at end of file diff --git a/pybamm/models/full_battery_models/lead_acid/full.py b/pybamm/models/full_battery_models/lead_acid/full.py index 5e13d911bf..70f70a29d4 100644 --- a/pybamm/models/full_battery_models/lead_acid/full.py +++ b/pybamm/models/full_battery_models/lead_acid/full.py @@ -135,4 +135,7 @@ def default_solver(self): ): return pybamm.ScipySolver() else: - return pybamm.ScikitsDaeSolver() + if pybamm.have_scikit_odes(): + return pybamm.ScikitsDaeSolver() + elif pybamm.have_idaklu(): # pragma: no cover + return pybamm.IDAKLU() diff --git a/pybamm/models/full_battery_models/lead_acid/higher_order.py b/pybamm/models/full_battery_models/lead_acid/higher_order.py index 4f3e424d97..600789cbb0 100644 --- a/pybamm/models/full_battery_models/lead_acid/higher_order.py +++ b/pybamm/models/full_battery_models/lead_acid/higher_order.py @@ -176,7 +176,10 @@ def default_solver(self): self.options["current collector"] != "uniform" or self.options["surface form"] == "algebraic" ): - return pybamm.ScikitsDaeSolver() + if pybamm.have_scikit_odes(): + return pybamm.ScikitsDaeSolver() + elif pybamm.have_idaklu(): # pragma: no cover + return pybamm.IDAKLU() else: return pybamm.ScipySolver() diff --git a/pybamm/models/full_battery_models/lithium_ion/dfn.py b/pybamm/models/full_battery_models/lithium_ion/dfn.py index c448c048b6..67a46814a9 100644 --- a/pybamm/models/full_battery_models/lithium_ion/dfn.py +++ b/pybamm/models/full_battery_models/lithium_ion/dfn.py @@ -116,5 +116,7 @@ def default_solver(self): Create and return the default solver for this model """ - # Default solver to DAE - return pybamm.ScikitsDaeSolver() + if pybamm.have_scikit_odes(): + return pybamm.ScikitsDaeSolver() + elif pybamm.have_idaklu(): # pragma: no cover + return pybamm.IDAKLU() diff --git a/pybamm/solvers/scikits_ode_solver.py b/pybamm/solvers/scikits_ode_solver.py index 542b15d19a..1a409ae92f 100644 --- a/pybamm/solvers/scikits_ode_solver.py +++ b/pybamm/solvers/scikits_ode_solver.py @@ -16,7 +16,7 @@ def have_scikits_odes(): - return scikits_odes_spec is None + return scikits_odes_spec is not None class ScikitsOdeSolver(pybamm.OdeSolver): diff --git a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_asymptotics_convergence.py b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_asymptotics_convergence.py index 62cf64f8f1..4928475f8b 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_asymptotics_convergence.py +++ b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_asymptotics_convergence.py @@ -8,7 +8,7 @@ class TestAsymptoticConvergence(unittest.TestCase): - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_leading_order_convergence(self): """ Check that the leading-order model solution converges linearly in C_e to the diff --git a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_compare_outputs.py b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_compare_outputs.py index 5dbd216562..699a920425 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_compare_outputs.py +++ b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_compare_outputs.py @@ -7,7 +7,7 @@ from tests import StandardOutputComparison -@unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") +@unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") class TestCompareOutputs(unittest.TestCase): def test_compare_averages_asymptotics(self): """ diff --git a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_composite.py b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_composite.py index 97feb0c297..fae4ffd57f 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_composite.py +++ b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_composite.py @@ -55,7 +55,7 @@ def test_basic_processing_differential(self): modeltest = tests.StandardModelTest(model, parameter_values=param) modeltest.test_all() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_algebraic(self): options = {"surface form": "algebraic"} model = pybamm.lead_acid.Composite(options) diff --git a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_foqs.py b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_foqs.py index 737a408dc6..473f855b58 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_foqs.py +++ b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_foqs.py @@ -64,7 +64,7 @@ def test_basic_processing_differential(self): modeltest = tests.StandardModelTest(model, parameter_values=param) modeltest.test_all() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_algebraic(self): options = { "surface form": "algebraic", diff --git a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_full.py b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_full.py index e09ec47eaa..7c829cea5a 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_full.py +++ b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_full.py @@ -9,14 +9,14 @@ class TestLeadAcidFull(unittest.TestCase): - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing(self): options = {"thermal": "isothermal"} model = pybamm.lead_acid.Full(options) modeltest = tests.StandardModelTest(model) modeltest.test_all(t_eval=np.linspace(0, 0.6)) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_with_convection(self): options = {"thermal": "isothermal", "convection": True} model = pybamm.lead_acid.Full(options) @@ -40,7 +40,7 @@ def test_optimisations(self): np.testing.assert_array_almost_equal(original, simp_and_known) np.testing.assert_array_almost_equal(original, simp_and_python) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_set_up(self): options = {"thermal": "isothermal"} model = pybamm.lead_acid.Full(options) @@ -58,7 +58,7 @@ def test_basic_processing_differential(self): modeltest = tests.StandardModelTest(model) modeltest.test_all() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_algebraic(self): options = {"surface form": "algebraic"} model = pybamm.lead_acid.Full(options) @@ -78,7 +78,7 @@ def test_optimisations(self): np.testing.assert_array_almost_equal(original, using_known_evals) np.testing.assert_array_almost_equal(original, simp_and_known, decimal=5) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_set_up(self): options = {"surface form": "differential"} model = pybamm.lead_acid.Full(options) diff --git a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_composite_side_reactions.py b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_composite_side_reactions.py index af855e849d..2d25498234 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_composite_side_reactions.py +++ b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_composite_side_reactions.py @@ -15,7 +15,7 @@ def test_basic_processing_differential(self): modeltest = tests.StandardModelTest(model) modeltest.test_all(skip_output_tests=True) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_algebraic(self): options = {"side reactions": ["oxygen"], "surface form": "algebraic"} model = pybamm.lead_acid.Composite(options) diff --git a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_full_side_reactions.py b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_full_side_reactions.py index eb4823a1d7..409998f96f 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_full_side_reactions.py +++ b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_full_side_reactions.py @@ -9,7 +9,7 @@ class TestLeadAcidFullSideReactions(unittest.TestCase): - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing(self): options = {"side reactions": ["oxygen"]} model = pybamm.lead_acid.Full(options) @@ -22,7 +22,7 @@ def test_basic_processing_differential(self): modeltest = tests.StandardModelTest(model) modeltest.test_all(skip_output_tests=True) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_algebraic(self): options = {"side reactions": ["oxygen"], "surface form": "algebraic"} model = pybamm.lead_acid.Full(options) diff --git a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_loqs_side_reactions.py b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_loqs_side_reactions.py index 1139a7d129..b62535bb69 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_loqs_side_reactions.py +++ b/tests/integration/test_models/test_full_battery_models/test_lead_acid/test_side_reactions/test_loqs_side_reactions.py @@ -23,7 +23,7 @@ def test_discharge_differential_varying_surface_area(self): modeltest = tests.StandardModelTest(model) modeltest.test_all() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_discharge_algebraic(self): options = {"surface form": "algebraic", "side reactions": ["oxygen"]} model = pybamm.lead_acid.LOQS(options) diff --git a/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py b/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py index 9dd672ebec..d16639af24 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py +++ b/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py @@ -8,7 +8,7 @@ import unittest -@unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") +@unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") class TestDFN(unittest.TestCase): def test_basic_processing(self): options = {"thermal": "isothermal"} @@ -18,7 +18,7 @@ def test_basic_processing(self): modeltest = tests.StandardModelTest(model, var_pts=var_pts) modeltest.test_all() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_1plus1D(self): options = {"current collector": "potential pair", "dimensionality": 1} model = pybamm.lithium_ion.DFN(options) @@ -35,7 +35,7 @@ def test_basic_processing_1plus1D(self): modeltest = tests.StandardModelTest(model, var_pts=var_pts) modeltest.test_all(skip_output_tests=True) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_2plus1D(self): options = {"current collector": "potential pair", "dimensionality": 2} model = pybamm.lithium_ion.DFN(options) diff --git a/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_spm.py b/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_spm.py index 0aed23ae2e..1d8810a29a 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_spm.py +++ b/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_spm.py @@ -14,7 +14,7 @@ def test_basic_processing(self): modeltest = tests.StandardModelTest(model) modeltest.test_all() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_1plus1D(self): options = {"current collector": "potential pair", "dimensionality": 1} model = pybamm.lithium_ion.SPM(options) @@ -31,7 +31,7 @@ def test_basic_processing_1plus1D(self): modeltest = tests.StandardModelTest(model, var_pts=var_pts) modeltest.test_all(skip_output_tests=True) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_2plus1D(self): options = {"current collector": "potential pair", "dimensionality": 2} model = pybamm.lithium_ion.SPM(options) diff --git a/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_spme.py b/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_spme.py index 46199f70d8..c411fb69f6 100644 --- a/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_spme.py +++ b/tests/integration/test_models/test_full_battery_models/test_lithium_ion/test_spme.py @@ -15,7 +15,7 @@ def test_basic_processing(self): modeltest = tests.StandardModelTest(model) modeltest.test_all() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_1plus1D(self): options = {"current collector": "potential pair", "dimensionality": 1} model = pybamm.lithium_ion.SPMe(options) @@ -32,7 +32,7 @@ def test_basic_processing_1plus1D(self): modeltest = tests.StandardModelTest(model, var_pts=var_pts) modeltest.test_all(skip_output_tests=True) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_basic_processing_2plus1D(self): options = {"current collector": "potential pair", "dimensionality": 2} model = pybamm.lithium_ion.SPMe(options) diff --git a/tests/integration/test_quick_plot.py b/tests/integration/test_quick_plot.py index d197b94a6b..6924486c54 100644 --- a/tests/integration/test_quick_plot.py +++ b/tests/integration/test_quick_plot.py @@ -8,7 +8,7 @@ class TestQuickPlot(unittest.TestCase): Tests that QuickPlot is created correctly """ - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_plot_lithium_ion(self): spm = pybamm.lithium_ion.SPM() spme = pybamm.lithium_ion.SPMe() @@ -73,7 +73,7 @@ def test_plot_lithium_ion(self): quick_plot.update(0.01) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_plot_lead_acid(self): loqs = pybamm.lead_acid.LOQS() geometry = loqs.default_geometry diff --git a/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_composite.py b/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_composite.py index 33a86fc467..2a9e16edba 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_composite.py +++ b/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_composite.py @@ -22,7 +22,7 @@ def test_well_posed_differential(self): class TestLeadAcidCompositeMultiDimensional(unittest.TestCase): - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_well_posed(self): model = pybamm.lead_acid.Composite( {"dimensionality": 1, "current collector": "potential pair"} @@ -58,7 +58,7 @@ def test_well_posed_differential(self): model = pybamm.lead_acid.Composite(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_well_posed_algebraic(self): options = {"surface form": "algebraic", "side reactions": ["oxygen"]} model = pybamm.lead_acid.Composite(options) diff --git a/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_full.py b/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_full.py index 8683ec464c..44737342cf 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_full.py +++ b/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_full.py @@ -15,7 +15,7 @@ def test_well_posed_with_convection(self): model = pybamm.lead_acid.Full(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_default_solver(self): model = pybamm.lead_acid.Full() self.assertIsInstance(model.default_solver, pybamm.ScikitsDaeSolver) @@ -37,7 +37,7 @@ def test_well_posed_algebraic(self): model = pybamm.lead_acid.Full(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_default_solver(self): options = {"surface form": "differential"} model = pybamm.lead_acid.Full(options) diff --git a/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_loqs.py b/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_loqs.py index c4bbfd75a5..681b362f1b 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_loqs.py +++ b/tests/unit/test_models/test_full_battery_models/test_lead_acid/test_loqs.py @@ -146,7 +146,7 @@ def test_well_posed_1plus1D(self): model = pybamm.lead_acid.LOQS(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_default_solver(self): options = {"surface form": "differential"} model = pybamm.lead_acid.LOQS(options) diff --git a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py index 7d72a0b19a..eb22429f2b 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py +++ b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_dfn.py @@ -48,7 +48,7 @@ def test_x_full_thermal_model_no_current_collector(self): with self.assertRaises(NotImplementedError): model = pybamm.lithium_ion.DFN(options) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_x_full_Nplus1D_not_implemented(self): # 1plus1D options = { @@ -91,7 +91,7 @@ def test_x_lumped_thermal_model_0D_current_collector(self): model = pybamm.lithium_ion.DFN(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_xyz_lumped_thermal_1D_current_collector(self): options = { "current collector": "potential pair", @@ -109,7 +109,7 @@ def test_xyz_lumped_thermal_1D_current_collector(self): model = pybamm.lithium_ion.DFN(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_xyz_lumped_thermal_2D_current_collector(self): options = { "current collector": "potential pair", @@ -127,7 +127,7 @@ def test_xyz_lumped_thermal_2D_current_collector(self): model = pybamm.lithium_ion.DFN(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_x_lumped_thermal_1D_current_collector(self): options = { "current collector": "potential pair", @@ -137,7 +137,7 @@ def test_x_lumped_thermal_1D_current_collector(self): model = pybamm.lithium_ion.DFN(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_x_lumped_thermal_2D_current_collector(self): options = { "current collector": "potential pair", @@ -147,7 +147,7 @@ def test_x_lumped_thermal_2D_current_collector(self): model = pybamm.lithium_ion.DFN(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_default_solver(self): options = {"thermal": "isothermal"} model = pybamm.lithium_ion.DFN(options) diff --git a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_spm.py b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_spm.py index 98723a5726..42336ac4c5 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_spm.py +++ b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_spm.py @@ -56,7 +56,7 @@ def test_x_full_thermal_model_no_current_collector(self): with self.assertRaises(NotImplementedError): model = pybamm.lithium_ion.SPM(options) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_x_full_Nplus1D_not_implemented(self): # 1plus1D options = { @@ -99,7 +99,7 @@ def test_x_lumped_thermal_model_0D_current_collector(self): model = pybamm.lithium_ion.SPM(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_xyz_lumped_thermal_1D_current_collector(self): options = { "current collector": "potential pair", @@ -117,7 +117,7 @@ def test_xyz_lumped_thermal_1D_current_collector(self): model = pybamm.lithium_ion.SPM(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_xyz_lumped_thermal_2D_current_collector(self): options = { "current collector": "potential pair", @@ -135,7 +135,7 @@ def test_xyz_lumped_thermal_2D_current_collector(self): model = pybamm.lithium_ion.SPM(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_x_lumped_thermal_1D_current_collector(self): options = { "current collector": "potential pair", @@ -145,7 +145,7 @@ def test_x_lumped_thermal_1D_current_collector(self): model = pybamm.lithium_ion.SPM(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_x_lumped_thermal_2D_current_collector(self): options = { "current collector": "potential pair", @@ -155,7 +155,7 @@ def test_x_lumped_thermal_2D_current_collector(self): model = pybamm.lithium_ion.SPM(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_default_solver(self): options = {"thermal": "isothermal"} model = pybamm.lithium_ion.SPM(options) diff --git a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_spme.py b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_spme.py index 0f2403db51..8f3b101cb7 100644 --- a/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_spme.py +++ b/tests/unit/test_models/test_full_battery_models/test_lithium_ion/test_spme.py @@ -55,7 +55,7 @@ def test_x_full_thermal_model_no_current_collector(self): with self.assertRaises(NotImplementedError): model = pybamm.lithium_ion.SPMe(options) - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_x_full_Nplus1D_not_implemented(self): # 1plus1D options = { @@ -98,7 +98,7 @@ def test_x_lumped_thermal_model_0D_current_collector(self): model = pybamm.lithium_ion.SPMe(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_xyz_lumped_thermal_1D_current_collector(self): options = { "current collector": "potential pair", @@ -116,7 +116,7 @@ def test_xyz_lumped_thermal_1D_current_collector(self): model = pybamm.lithium_ion.SPMe(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_xyz_lumped_thermal_2D_current_collector(self): options = { "current collector": "potential pair", @@ -126,7 +126,7 @@ def test_xyz_lumped_thermal_2D_current_collector(self): model = pybamm.lithium_ion.SPMe(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_x_lumped_thermal_1D_current_collector(self): options = { "current collector": "potential pair", @@ -144,7 +144,7 @@ def test_x_lumped_thermal_1D_current_collector(self): model = pybamm.lithium_ion.SPMe(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_x_lumped_thermal_2D_current_collector(self): options = { "current collector": "potential pair", @@ -154,7 +154,7 @@ def test_x_lumped_thermal_2D_current_collector(self): model = pybamm.lithium_ion.SPMe(options) model.check_well_posedness() - @unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") + @unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") def test_default_solver(self): options = {"thermal": "isothermal"} model = pybamm.lithium_ion.SPMe(options) diff --git a/tests/unit/test_solvers/test_scikits_solvers.py b/tests/unit/test_solvers/test_scikits_solvers.py index e8b503f2fe..436043cf20 100644 --- a/tests/unit/test_solvers/test_scikits_solvers.py +++ b/tests/unit/test_solvers/test_scikits_solvers.py @@ -9,7 +9,7 @@ from tests import get_mesh_for_testing, get_discretisation_for_testing -@unittest.skipIf(pybamm.have_scikits_odes(), "scikits.odes not installed") +@unittest.skipIf(~pybamm.have_scikits_odes(), "scikits.odes not installed") class TestScikitsSolvers(unittest.TestCase): def test_ode_integrate(self): # Constant