Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:kratman/PyBaMM into feat/useTemp…
Browse files Browse the repository at this point in the history
…Directories
  • Loading branch information
kratman committed Sep 29, 2023
2 parents 10c7270 + ad5f51c commit 708f721
Show file tree
Hide file tree
Showing 95 changed files with 3,285 additions and 1,261 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

## Features

- Idaklu solver can be given a list of variables to calculate during the solve ([#3217](https://github.com/pybamm-team/PyBaMM/pull/3217))
- Enable multithreading in IDAKLU solver ([#2947](https://github.com/pybamm-team/PyBaMM/pull/2947))
- If a solution contains cycles and steps, the cycle number and step number are now saved when `solution.save_data()` is called ([#2931](https://github.com/pybamm-team/PyBaMM/pull/2931))
- Experiments can now be given a `start_time` to define when each step should be triggered ([#2616](https://github.com/pybamm-team/PyBaMM/pull/2616))
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ pybind11_add_module(idaklu
pybamm/solvers/c_solvers/idaklu/casadi_functions.hpp
pybamm/solvers/c_solvers/idaklu/casadi_solver.cpp
pybamm/solvers/c_solvers/idaklu/casadi_solver.hpp
pybamm/solvers/c_solvers/idaklu/casadi_sundials_functions.hpp
pybamm/solvers/c_solvers/idaklu/CasadiSolver.cpp
pybamm/solvers/c_solvers/idaklu/CasadiSolver.hpp
pybamm/solvers/c_solvers/idaklu/CasadiSolverOpenMP.cpp
pybamm/solvers/c_solvers/idaklu/CasadiSolverOpenMP.hpp
pybamm/solvers/c_solvers/idaklu/CasadiSolverOpenMP_solvers.cpp
pybamm/solvers/c_solvers/idaklu/CasadiSolverOpenMP_solvers.hpp
pybamm/solvers/c_solvers/idaklu/casadi_sundials_functions.cpp
pybamm/solvers/c_solvers/idaklu/casadi_sundials_functions.hpp
pybamm/solvers/c_solvers/idaklu/common.hpp
pybamm/solvers/c_solvers/idaklu/python.hpp
pybamm/solvers/c_solvers/idaklu/python.cpp
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/notebooks/batch_study.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"\n",
"# loading up 3 models to compare\n",
Expand Down Expand Up @@ -224,7 +224,7 @@
"source": [
"# using less number of images in the example\n",
"# for a smoother GIF use more images\n",
"batch_study.create_gif(number_of_images=5, duration=0.2)"
"batch_study.create_gif(number_of_images=5, duration=0.2, output_filename=\"batch.gif\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/notebooks/callbacks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q\n",
"%pip install \"pybamm[plot,cite]\" -q\n",
"import pybamm\n",
"\n",
"model = pybamm.lithium_ion.DFN()\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/notebooks/change-settings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"import os\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"import os\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"from datetime import datetime"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"metadata": {},
"outputs": [],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import matplotlib.pyplot as plt\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import os\n",
"os.chdir(pybamm.__path__[0]+'/..')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"model = pybamm.lithium_ion.SPMe()\n",
"sim = pybamm.Simulation(model)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33mWARNING: You are using pip version 21.0.1; however, version 21.1 is available.\n",
"You should consider upgrading via the '/Users/vsulzer/Documents/Energy_storage/PyBaMM/.tox/dev/bin/python -m pip install --upgrade pip' command.\u001b[0m\n",
"\u001B[33mWARNING: You are using pip version 21.0.1; however, version 21.1 is available.\n",
"You should consider upgrading via the '/Users/vsulzer/Documents/Energy_storage/PyBaMM/.tox/dev/bin/python -m pip install --upgrade pip' command.\u001B[0m\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"\n",
"import pybamm\n",
"import pandas as pd\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import matplotlib.pyplot as plt"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/notebooks/models/DFN.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/notebooks/models/MPM.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import matplotlib.pyplot as plt"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/notebooks/models/MSMR.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import matplotlib.pyplot as plt"
]
Expand Down
6 changes: 3 additions & 3 deletions docs/source/examples/notebooks/models/SEI-on-cracks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"output_type": "stream",
"text": [
"\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip available: \u001b[0m\u001b[31;49m22.3.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.0.1\u001b[0m\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n",
"\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m A new release of pip available: \u001B[0m\u001B[31;49m22.3.1\u001B[0m\u001B[39;49m -> \u001B[0m\u001B[32;49m23.0.1\u001B[0m\n",
"\u001B[1m[\u001B[0m\u001B[34;49mnotice\u001B[0m\u001B[1;39;49m]\u001B[0m\u001B[39;49m To update, run: \u001B[0m\u001B[32;49mpip install --upgrade pip\u001B[0m\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import matplotlib.pyplot as plt"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/notebooks/models/SPM.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"import os\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/notebooks/models/SPMe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import os\n",
"import matplotlib.pyplot as plt\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"outputs": [],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import numpy as np\n",
"import os\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import os\n",
"import pandas as pd\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import os\n",
"os.chdir(pybamm.__path__[0]+'/..')\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import os\n",
"import numpy as np\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"metadata": {},
"outputs": [],
"source": [
"#%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"#%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import os\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
],
"source": [
"%pip install pybamm[plot,cite] -q # install PyBaMM if it is not installed\n",
"%pip install \"pybamm[plot,cite]\" -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
"import matplotlib.pyplot as plt"
]
Expand Down
Loading

0 comments on commit 708f721

Please sign in to comment.