From 45949534f89413a8b94c0cb59fde9015e4a4e2bb Mon Sep 17 00:00:00 2001 From: allevitan Date: Tue, 16 Jun 2026 14:24:18 +0200 Subject: [PATCH] Remove the datset arg from all remaining examples of model.inspect() in the example code --- examples/fancy_ptycho_inline.ipynb | 6 +++--- examples/fancy_ptycho_interactive.ipynb | 10 +++++----- examples/simple_ptycho.py | 2 +- examples/tutorial_finale.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/fancy_ptycho_inline.ipynb b/examples/fancy_ptycho_inline.ipynb index f5cab0f..b0dc876 100644 --- a/examples/fancy_ptycho_inline.ipynb +++ b/examples/fancy_ptycho_inline.ipynb @@ -66,7 +66,7 @@ "# Workaround reconstruction pattern for interactive plotting in jupyter:\n", "# First, a standalone cell to plot the current model state\n", "\n", - "model.inspect(dataset, replot_all=True);" + "model.inspect(replot_all=True);" ] }, { @@ -96,7 +96,7 @@ "source": [ "# Save out the results\n", "\n", - "model.save_to_h5('lab_ptycho_reconstruction.h5', dataset)" + "model.save_to_h5('lab_ptycho_reconstruction.h5');" ] }, { @@ -114,7 +114,7 @@ "model.tidy_probes()\n", "\n", "# Final plotting\n", - "model.inspect(dataset)\n", + "model.inspect()\n", "model.compare(dataset);" ] }, diff --git a/examples/fancy_ptycho_interactive.ipynb b/examples/fancy_ptycho_interactive.ipynb index 0e9adad..8d5343f 100644 --- a/examples/fancy_ptycho_interactive.ipynb +++ b/examples/fancy_ptycho_interactive.ipynb @@ -54,7 +54,7 @@ "# Then, create a reconstructor object and view the initialized model\n", "\n", "recon = cdtools.reconstructors.AdamReconstructor(model, dataset)\n", - "model.inspect(dataset);" + "model.inspect();" ] }, { @@ -72,12 +72,12 @@ "while model.epoch < 50:\n", " for loss in recon.optimize(1, lr=0.02, batch_size=10):\n", " print(model.report())\n", - " model.inspect(dataset, min_interval=10)\n", + " model.inspect(min_interval=10)\n", "\n", "while model.epoch < 100:\n", " for loss in recon.optimize(1, lr=0.005, batch_size=10):\n", " print(model.report())\n", - " model.inspect(dataset, min_interval=10)" + " model.inspect(min_interval=10)" ] }, { @@ -89,7 +89,7 @@ "source": [ "# Save out the results\n", "\n", - "model.save_to_h5('lab_ptycho_reconstruction.h5', dataset)" + "model.save_to_h5('lab_ptycho_reconstruction.h5')" ] }, { @@ -107,7 +107,7 @@ "model.tidy_probes()\n", "\n", "# Final plotting\n", - "model.inspect(dataset)\n", + "model.inspect()\n", "model.compare(dataset);" ] }, diff --git a/examples/simple_ptycho.py b/examples/simple_ptycho.py index f2aec3b..dfd78c1 100644 --- a/examples/simple_ptycho.py +++ b/examples/simple_ptycho.py @@ -23,7 +23,7 @@ if t.cuda.is_available(): model.to(device='cuda') dataset.get_as(device='cuda') -model.inspect(dataset) +model.inspect() # We run the reconstruction for loss in model.Adam_optimize(100, dataset, batch_size=10): diff --git a/examples/tutorial_finale.py b/examples/tutorial_finale.py index b92155e..eed4514 100644 --- a/examples/tutorial_finale.py +++ b/examples/tutorial_finale.py @@ -20,6 +20,6 @@ for loss in model.Adam_optimize(10, dataset): model.inspect() print(model.report()) -model.inspect(dataset) +model.inspect() model.compare(dataset) plt.show()