From 3fd63b44c5edfb4ea52d24d0f861e2fbb3c903c1 Mon Sep 17 00:00:00 2001 From: ChocolateCharlie Date: Wed, 29 Jun 2022 22:13:52 +0200 Subject: [PATCH] Pythonify writing of parameter initializations --- jupyter_notebooks/createModel.ipynb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jupyter_notebooks/createModel.ipynb b/jupyter_notebooks/createModel.ipynb index 6ef050f7..e1ee34cb 100644 --- a/jupyter_notebooks/createModel.ipynb +++ b/jupyter_notebooks/createModel.ipynb @@ -414,10 +414,8 @@ "source": [ "# Write parameter ICs\n", "fileModel.write(\"\\n # Parameter initializations:\\n\")\n", - "count = 0\n", - "for param in paramnames:\n", - " fileModel.write(\" %s = %.6e;\\n\" % (param, np.double(paramvals[count])))\n", - " count += 1" + "for idx, val in enumerate(paramnames):\n", + " fileModel.write(\" %s = %.6e;\\n\" % (val, np.double(paramvals[idx])))\n" ] }, {