Skip to content

Commit

Permalink
Merge branch 'develop' into pybind11-build-time-dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Dec 16, 2023
2 parents 7c717f9 + e2d8792 commit 92ca984
Show file tree
Hide file tree
Showing 98 changed files with 1,273 additions and 1,359 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,15 @@
"contributions": [
"infra"
]
},
{
"login": "prady0t",
"name": "Pradyot Ranjan",
"avatar_url": "https://avatars.githubusercontent.com/u/99216956?v=4",
"profile": "https://github.com/prady0t",
"contributions": [
"infra"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ a63e49ece0f9336d1f5c2562f7459e555c6e6693
5273214b585c5a4286609aed40e0b092d0e05f42
# migrate config to pyproject.toml - https://github.com/pybamm-team/PyBaMM/pull/3557
12c5d77203bd93542785d237bac00bad5ed5469a
# activated pyupgrade - https://github.com/pybamm-team/PyBaMM/pull/3579
ff6d81c01331c7d269303b4a8321d9881bdf98fa
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[![code style](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-70-orange.svg)](#-contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-71-orange.svg)](#-contributors)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

</div>
Expand Down Expand Up @@ -275,6 +275,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/shubhambhar007"><img src="https://avatars.githubusercontent.com/u/32607282?v=4?s=100" width="100px;" alt="Shubham Bhardwaj"/><br /><sub><b>Shubham Bhardwaj</b></sub></a><br /><a href="#infra-shubhambhar007" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jlauber18"><img src="https://avatars.githubusercontent.com/u/28939653?v=4?s=100" width="100px;" alt="Jonathan Lauber"/><br /><sub><b>Jonathan Lauber</b></sub></a><br /><a href="#infra-jlauber18" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/prady0t"><img src="https://avatars.githubusercontent.com/u/99216956?v=4?s=100" width="100px;" alt="Pradyot Ranjan"/><br /><sub><b>Pradyot Ranjan</b></sub></a><br /><a href="#infra-prady0t" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
</tr>
</tbody>
</table>

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/work_precision_sets/time_vs_abstols.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

content = f"# PyBaMM {pybamm.__version__}\n## Solve Time vs Abstols\n<img src='./benchmark_images/time_vs_abstols_{pybamm.__version__}.png'>\n"

with open("./benchmarks/release_work_precision_sets.md", "r") as original:
with open("./benchmarks/release_work_precision_sets.md") as original:
data = original.read()
with open("./benchmarks/release_work_precision_sets.md", "w") as modified:
modified.write(f"{content}\n{data}")
2 changes: 1 addition & 1 deletion benchmarks/work_precision_sets/time_vs_dt_max.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@

content = f"## Solve Time vs dt_max\n<img src='./benchmark_images/time_vs_dt_max_{pybamm.__version__}.png'>\n"

with open("./benchmarks/release_work_precision_sets.md", "r") as original:
with open("./benchmarks/release_work_precision_sets.md") as original:
data = original.read()
with open("./benchmarks/release_work_precision_sets.md", "w") as modified:
modified.write(f"{content}\n{data}")
2 changes: 1 addition & 1 deletion benchmarks/work_precision_sets/time_vs_mesh_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

content = f"## Solve Time vs Mesh size\n<img src='./benchmark_images/time_vs_mesh_size_{pybamm.__version__}.png'>\n"

with open("./benchmarks/release_work_precision_sets.md", "r") as original:
with open("./benchmarks/release_work_precision_sets.md") as original:
data = original.read()
with open("./benchmarks/release_work_precision_sets.md", "w") as modified:
modified.write(f"{content}\n{data}")
2 changes: 1 addition & 1 deletion benchmarks/work_precision_sets/time_vs_no_of_states.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

content = f"## Solve Time vs Number of states\n<img src='./benchmark_images/time_vs_no_of_states_{pybamm.__version__}.png'>\n"

with open("./benchmarks/release_work_precision_sets.md", "r") as original:
with open("./benchmarks/release_work_precision_sets.md") as original:
data = original.read()
with open("./benchmarks/release_work_precision_sets.md", "w") as modified:
modified.write(f"{content}\n{data}")
2 changes: 1 addition & 1 deletion benchmarks/work_precision_sets/time_vs_reltols.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

content = f"## Solve Time vs Reltols\n<img src='./benchmark_images/time_vs_reltols_{pybamm.__version__}.png'>\n"

with open("./benchmarks/release_work_precision_sets.md", "r") as original:
with open("./benchmarks/release_work_precision_sets.md") as original:
data = original.read()
with open("./benchmarks/release_work_precision_sets.md", "w") as modified:
modified.write(f"{content}\n{data}")
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
Expand Down Expand Up @@ -168,7 +167,7 @@
],
}

html_title = "%s v%s Manual" % (project, version)
html_title = f"{project} v{version} Manual"
html_last_updated_fmt = "%Y-%m-%d"
html_css_files = ["pybamm.css"]
html_context = {"default_mode": "light"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
"\n",
"r = mesh[\"negative particle\"].nodes # radial position\n",
"time = 1000 # time in seconds\n",
"ax2.plot(r * 1e6, c(t=time, r=r), label=\"t={}[s]\".format(time))\n",
"ax2.plot(r * 1e6, c(t=time, r=r), label=f\"t={time}[s]\")\n",
"ax2.set_xlabel(\"Particle radius [microns]\")\n",
"ax2.set_ylabel(\"Concentration [mol.m-3]\")\n",
"ax2.legend()\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@
"\n",
"# solve\n",
"safe_sim.solve([0, 3600])\n",
"print(\"Safe mode solve time: {}\".format(safe_sim.solution.solve_time))\n",
"print(f\"Safe mode solve time: {safe_sim.solution.solve_time}\")\n",
"fast_sim.solve([0, 3600])\n",
"print(\"Fast mode solve time: {}\".format(fast_sim.solution.solve_time))\n",
"print(f\"Fast mode solve time: {fast_sim.solution.solve_time}\")\n",
"\n",
"# plot solutions\n",
"pybamm.dynamic_plot([safe_sim, fast_sim])"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"\n",
" # load the comsol results\n",
" comsol_results_path = pybamm.get_parameters_filepath(\n",
" \"input/comsol_results/comsol_{}C.pickle\".format(key),\n",
" f\"input/comsol_results/comsol_{key}C.pickle\",\n",
" )\n",
" comsol_variables = pickle.load(open(comsol_results_path, 'rb'))\n",
" comsol_time = comsol_variables[\"time\"]\n",
Expand Down Expand Up @@ -203,7 +203,7 @@
" voltage_sol,\n",
" color=color,\n",
" linestyle=\"-\",\n",
" label=\"{} C\".format(C_rate),\n",
" label=f\"{C_rate} C\",\n",
" )\n",
" voltage_difference_plot.plot(\n",
" discharge_capacity_sol[0:end_index], voltage_difference, color=color\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
" solver = pybamm.CasadiSolver()\n",
" timer.reset()\n",
" solution = solver.solve(model, t_eval, inputs={\"Current function [A]\": 1})\n",
" print(\"Solved the {} in {}\".format(model.name, timer.time()))\n",
" print(f\"Solved the {model.name} in {timer.time()}\")\n",
" solutions[model_name] = solution"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@
"for sim in simulations:\n",
" sim.solve(t_eval, inputs={\"Current function [A]\": 0.68})\n",
" solutions_1C.append(sim.solution)\n",
" print(\"Particle model: {}\".format(sim.model.name))\n",
" print(\"Solve time: {}s\".format(sim.solution.solve_time))"
" print(f\"Particle model: {sim.model.name}\")\n",
" print(f\"Solve time: {sim.solution.solve_time}s\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examples/notebooks/models/lead-acid.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
" solver = pybamm.CasadiSolver()\n",
" timer.reset()\n",
" solution = solver.solve(model, t_eval, inputs={\"Current function [A]\": 1})\n",
" print(\"Solved the {} in {}\".format(model.name, timer.time()))\n",
" print(f\"Solved the {model.name} in {timer.time()}\")\n",
" solutions[model] = solution"
]
},
Expand Down
Loading

0 comments on commit 92ca984

Please sign in to comment.