Skip to content

Commit

Permalink
Merge pull request pybamm-team#3373 from kratman/bug/applePip
Browse files Browse the repository at this point in the history
Bug fix: Make examples more compatible with Mac
  • Loading branch information
Saransh-cpp authored Sep 29, 2023
2 parents d238192 + c5aa3ce commit ad5f51c
Show file tree
Hide file tree
Showing 68 changed files with 94 additions and 83 deletions.
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
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 matplotlib.pyplot as plt\n",
"import numpy as np"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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",
"from numpy import pi\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/notebooks/models/latexify.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"
]
},
Expand Down
Loading

0 comments on commit ad5f51c

Please sign in to comment.