diff --git a/docs/source/examples/Futures.ipynb b/docs/source/examples/Futures.ipynb index a5af5cf7..c089edba 100644 --- a/docs/source/examples/Futures.ipynb +++ b/docs/source/examples/Futures.ipynb @@ -186,7 +186,7 @@ ], "source": [ "f = rc[-1].apply(os.getpid)\n", - "f.add_done_callback(lambda _: print(\"I got PID: %i\" % _.result()))\n", + "f.add_done_callback(lambda _: print(f\"I got PID: {_.result()}\"))\n", "f.result()" ] }, @@ -602,7 +602,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.9" + "version": "3.11.10" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/docs/source/examples/Monitoring an MPI Simulation - 1.ipynb b/docs/source/examples/Monitoring an MPI Simulation - 1.ipynb index 2b149205..b832343b 100644 --- a/docs/source/examples/Monitoring an MPI Simulation - 1.ipynb +++ b/docs/source/examples/Monitoring an MPI Simulation - 1.ipynb @@ -127,7 +127,7 @@ "bcast = mpi.bcast\n", "barrier = mpi.barrier\n", "rank = mpi.rank\n", - "print(\"MPI rank: %i/%i\" % (mpi.rank, mpi.size))" + "print(f\"MPI rank: {mpi.rank}/{mpi.size}\")" ] }, { @@ -300,7 +300,7 @@ " nx, nyt, j, nsteps = view.pull(['nx', 'nyt', 'j', 'nsteps'], targets=0, block=True)\n", " fig, ax = plt.subplots()\n", " ax.contourf(Z)\n", - " ax.set_title('Mesh: %i x %i, step %i/%i' % (nx, nyt, j + 1, nsteps))\n", + " ax.set_title(f\"Mesh: {nx} x {nyt}, step {j + 1}/{nsteps}\")\n", " plt.axis('off')\n", " # We clear the notebook output before plotting this if in-place plot updating is requested\n", " if in_place:\n", @@ -566,7 +566,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.9" + "version": "3.11.10" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/docs/source/examples/Monitoring an MPI Simulation - 2.ipynb b/docs/source/examples/Monitoring an MPI Simulation - 2.ipynb index 8c0c7d91..cca88ab4 100644 --- a/docs/source/examples/Monitoring an MPI Simulation - 2.ipynb +++ b/docs/source/examples/Monitoring an MPI Simulation - 2.ipynb @@ -119,7 +119,7 @@ "bcast = mpi.bcast\n", "barrier = mpi.barrier\n", "rank = mpi.rank\n", - "print(\"MPI rank: %i/%i\" % (mpi.rank, mpi.size))" + "print(f\"MPI rank: {mpi.rank}/{mpi.size}\")" ] }, { @@ -270,7 +270,7 @@ " else:\n", " fig, ax = plt.subplots()\n", " ax.contourf(Z)\n", - " ax.set_title(\"Mesh: %i x %i, step %i/%i\" % (nx, nyt, j + 1, nsteps))\n", + " ax.set_title(f\"Mesh: {nx} x {nyt}, step {j + 1}/{nsteps}\")\n", " plt.axis(\"off\")\n", " # We clear the notebook output before plotting this if in-place\n", " # plot updating is requested\n", @@ -420,7 +420,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.9" + "version": "3.11.10" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/docs/source/examples/Using Dill.ipynb b/docs/source/examples/Using Dill.ipynb index 75e6b515..26d794a2 100644 --- a/docs/source/examples/Using Dill.ipynb +++ b/docs/source/examples/Using Dill.ipynb @@ -44,7 +44,7 @@ "\n", " def has_closure(b):\n", " product = a * b\n", - " f.write(\"%i: %g\\n\" % (os.getpid(), product))\n", + " f.write(f\"{os.getpid()}: {product:g}\\n\")\n", " f.flush()\n", " return product\n", "\n", @@ -596,109 +596,11 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.9" + "version": "3.11.10" }, "widgets": { "application/vnd.jupyter.widget-state+json": { - "state": { - "1086f7640c6148b7bb5cd4202d114ba3": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "HTMLStyleModel", - "state": { - "description_width": "", - "font_size": null, - "text_color": null - } - }, - "37585be691034dba9d04f0c82d2d8a51": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "2.0.0", - "model_name": "LayoutModel", - "state": {} - }, - "610913dc61674fd5ac61f9f8fa714f47": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "2.0.0", - "model_name": "LayoutModel", - "state": {} - }, - "61aff84b5838480c92987db3608a698d": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "HTMLStyleModel", - "state": { - "description_width": "", - "font_size": null, - "text_color": null - } - }, - "86f27c1b3bf840c8b0b5c0323f0d6264": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "FloatProgressModel", - "state": { - "bar_style": "success", - "layout": "IPY_MODEL_b2ded84395ea4d53891f184694793eff", - "max": 2, - "style": "IPY_MODEL_f458c2a21bc24550b2a0dd2b7f014046", - "value": 2 - } - }, - "8bdc6187bd964e89acfe57c818fccec6": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "HTMLModel", - "state": { - "layout": "IPY_MODEL_e2955a27d1a3468582d3cd1466737ba7", - "style": "IPY_MODEL_61aff84b5838480c92987db3608a698d", - "value": "100%" - } - }, - "a6d41c9031314b94851b72e499e8afbe": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "HTMLModel", - "state": { - "layout": "IPY_MODEL_37585be691034dba9d04f0c82d2d8a51", - "style": "IPY_MODEL_1086f7640c6148b7bb5cd4202d114ba3", - "value": " 2/2 [00:00<00:00,  1.18engine/s]" - } - }, - "b2ded84395ea4d53891f184694793eff": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "2.0.0", - "model_name": "LayoutModel", - "state": {} - }, - "d2ece3d105ca4c488a76246625ef8962": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "HBoxModel", - "state": { - "children": [ - "IPY_MODEL_8bdc6187bd964e89acfe57c818fccec6", - "IPY_MODEL_86f27c1b3bf840c8b0b5c0323f0d6264", - "IPY_MODEL_a6d41c9031314b94851b72e499e8afbe" - ], - "layout": "IPY_MODEL_610913dc61674fd5ac61f9f8fa714f47" - } - }, - "e2955a27d1a3468582d3cd1466737ba7": { - "model_module": "@jupyter-widgets/base", - "model_module_version": "2.0.0", - "model_name": "LayoutModel", - "state": {} - }, - "f458c2a21bc24550b2a0dd2b7f014046": { - "model_module": "@jupyter-widgets/controls", - "model_module_version": "2.0.0", - "model_name": "ProgressStyleModel", - "state": { - "description_width": "" - } - } - }, + "state": {}, "version_major": 2, "version_minor": 0 }