Skip to content

Commit

Permalink
pybamm-team#1330 add print_citations to notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
brosaplanella committed Jan 24, 2021
1 parent 7c6f299 commit a17bac6
Show file tree
Hide file tree
Showing 48 changed files with 6,353 additions and 800 deletions.
43 changes: 37 additions & 6 deletions examples/notebooks/Creating Models/1-an-ode-model.ipynb

Large diffs are not rendered by default.

45 changes: 38 additions & 7 deletions examples/notebooks/Creating Models/2-a-pde-model.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
Expand Down Expand Up @@ -284,14 +292,14 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2020-05-30 11:14:09,214 - [WARNING] processed_variable.get_spatial_scale(497): No scale set for spatial variable r_n. Using default of 1 [m].\n",
"2020-05-30 11:14:09,244 - [WARNING] processed_variable.get_spatial_scale(497): No scale set for spatial variable r_n. Using default of 1 [m].\n"
"2021-01-24 19:29:00,043 - [WARNING] processed_variable.get_spatial_scale(518): No length scale set for negative particle. Using default of 1 [m].\n",
"2021-01-24 19:29:00,105 - [WARNING] processed_variable.get_spatial_scale(518): No length scale set for negative particle. Using default of 1 [m].\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c043c0f27ffc46f88fe69b0cbdf14d46",
"model_id": "143b65882ebc453292887b839483c1b2",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -367,12 +375,35 @@
"In the [next notebook](./5-a-simple-SEI-model.ipynb) we consider a simple model for SEI growth, and show how to correctly pose the model in non-dimensional form and then create and solve it using pybamm."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## References\n",
"\n",
"The relevant papers for this notebook are:"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1] Joel A. E. Andersson, Joris Gillis, Greg Horn, James B. Rawlings, and Moritz Diehl. CasADi – A software framework for nonlinear optimization and optimal control. Mathematical Programming Computation, 11(1):1–36, 2019. doi:10.1007/s12532-018-0139-4.\n",
"[2] Charles R. Harris, K. Jarrod Millman, Stéfan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, and others. Array programming with NumPy. Nature, 585(7825):357–362, 2020. doi:10.1038/s41586-020-2649-2.\n",
"[3] Valentin Sulzer, Scott G. Marquis, Robert Timms, Martin Robinson, and S. Jon Chapman. Python Battery Mathematical Modelling (PyBaMM). ECSarXiv. February, 2020. doi:10.1149/osf.io/67ckj.\n",
"[4] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, and others. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods, 17(3):261–272, 2020. doi:10.1038/s41592-019-0686-2.\n",
"\n"
]
}
],
"source": [
"pybamm.print_citations()"
]
}
],
"metadata": {
Expand All @@ -391,7 +422,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.7"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
45 changes: 38 additions & 7 deletions examples/notebooks/Creating Models/5-a-simple-SEI-model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,15 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [
"%pip install pybamm -q # install PyBaMM if it is not installed\n",
"import pybamm\n",
Expand Down Expand Up @@ -538,7 +546,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"2020-05-30 11:30:30,931 - [WARNING] processed_variable.get_spatial_scale(497): No scale set for spatial variable x. Using default of 1 [m].\n"
"2021-01-24 19:29:11,759 - [WARNING] processed_variable.get_spatial_scale(518): No length scale set for SEI layer. Using default of 1 [m].\n"
]
}
],
Expand Down Expand Up @@ -601,7 +609,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "03d0d8fd63324d16858941bfcbe513be",
"model_id": "d66f188c61a14a3682d48294f6e5d108",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -646,12 +654,35 @@
"The purpose of this notebook has been to go through the steps involved in getting a simple model working within PyBaMM. However, if you plan on reusing your model and want greater flexibility then we recommend that you create a new class for your model. We have set out instructions on how to do this in the \"Adding a Model\" tutorial in the documentation. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## References\n",
"\n",
"The relevant papers for this notebook are:"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[1] Joel A. E. Andersson, Joris Gillis, Greg Horn, James B. Rawlings, and Moritz Diehl. CasADi – A software framework for nonlinear optimization and optimal control. Mathematical Programming Computation, 11(1):1–36, 2019. doi:10.1007/s12532-018-0139-4.\n",
"[2] Charles R. Harris, K. Jarrod Millman, Stéfan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, and others. Array programming with NumPy. Nature, 585(7825):357–362, 2020. doi:10.1038/s41586-020-2649-2.\n",
"[3] Valentin Sulzer, Scott G. Marquis, Robert Timms, Martin Robinson, and S. Jon Chapman. Python Battery Mathematical Modelling (PyBaMM). ECSarXiv. February, 2020. doi:10.1149/osf.io/67ckj.\n",
"[4] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, and others. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods, 17(3):261–272, 2020. doi:10.1038/s41592-019-0686-2.\n",
"\n"
]
}
],
"source": [
"pybamm.print_citations()"
]
}
],
"metadata": {
Expand All @@ -670,7 +701,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
{
"data": {
"text/plain": [
"<pybamm.solvers.solution.Solution at 0x7f20b554f650>"
"<pybamm.solvers.solution.Solution at 0x7fc2b39da310>"
]
},
"execution_count": 4,
Expand All @@ -110,7 +110,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2b323f5e668d4135834681aac97571ce",
"model_id": "0d24d4cdcfd1440aae72b0371ddcdec4",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -139,19 +139,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## References"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We would be grateful if you could cite the papers relevant to your code. These will change depending on what models and solvers you use. To find out which papers you should cite, you can run:"
"## References\n",
"\n",
"If you write a paper that uses PyBaMM, we would be grateful if you could cite the papers relevant to your code. These will change depending on what models and solvers you use. To find out which papers you should cite, you can run:"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -170,13 +165,6 @@
"source": [
"pybamm.print_citations()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b9ba084e8e6444c48e8ae6244b753040",
"model_id": "33d9970753e647a98da2824a1a72a6a9",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -103,7 +103,7 @@
{
"data": {
"text/plain": [
"<pybamm.plotting.quick_plot.QuickPlot at 0x7f5d8b1e5a50>"
"<pybamm.plotting.quick_plot.QuickPlot at 0x7fab1bee6490>"
]
},
"execution_count": 4,
Expand All @@ -126,20 +126,17 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## References"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The relevant papers to this notebook are:"
"## References\n",
"\n",
"The relevant papers for this notebook are:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
Expand All @@ -157,13 +154,6 @@
"source": [
"pybamm.print_citations()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit a17bac6

Please sign in to comment.