diff --git a/examples-proposed/004-jupyter-append/sim/input_dir/basic.ipynb b/examples-proposed/004-jupyter-append/sim/input_dir/basic.ipynb index 7c50b5b..697cccf 100644 --- a/examples-proposed/004-jupyter-append/sim/input_dir/basic.ipynb +++ b/examples-proposed/004-jupyter-append/sim/input_dir/basic.ipynb @@ -12,12 +12,24 @@ "\n", "# In this example, this notebook is generated during the time loop.\n", "\n", - "mapping = {}\n", - "for file in DATA_FILES.values():\n", - " with open(file, 'rb') as f:\n", - " mapping[file] = f.read()\n", - "print(mapping)\n" + "import os\n", + "\n", + "for timestep, filelist in DATA_FILES.items():\n", + " print(timestep)\n", + " print('-----------')\n", + " for file in filelist:\n", + " with open(file, 'rb') as f:\n", + " print(os.path.basename(file), f.read())\n", + " print()" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f793c9b1", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/examples-proposed/005-jupyter-replace/sim/input_dir/basic.ipynb b/examples-proposed/005-jupyter-replace/sim/input_dir/basic.ipynb index 7c50b5b..b32a164 100644 --- a/examples-proposed/005-jupyter-replace/sim/input_dir/basic.ipynb +++ b/examples-proposed/005-jupyter-replace/sim/input_dir/basic.ipynb @@ -12,11 +12,15 @@ "\n", "# In this example, this notebook is generated during the time loop.\n", "\n", - "mapping = {}\n", - "for file in DATA_FILES.values():\n", - " with open(file, 'rb') as f:\n", - " mapping[file] = f.read()\n", - "print(mapping)\n" + "import os\n", + "\n", + "for timestep, filelist in DATA_FILES.items():\n", + " print(timestep)\n", + " print('-----------')\n", + " for file in filelist:\n", + " with open(file, 'rb') as f:\n", + " print(os.path.basename(file), f.read())\n", + " print()" ] } ], diff --git a/examples-proposed/006-jupyter-multiple-notebooks/sim/input_dir/basic.ipynb b/examples-proposed/006-jupyter-multiple-notebooks/sim/input_dir/basic.ipynb index 7c50b5b..b32a164 100644 --- a/examples-proposed/006-jupyter-multiple-notebooks/sim/input_dir/basic.ipynb +++ b/examples-proposed/006-jupyter-multiple-notebooks/sim/input_dir/basic.ipynb @@ -12,11 +12,15 @@ "\n", "# In this example, this notebook is generated during the time loop.\n", "\n", - "mapping = {}\n", - "for file in DATA_FILES.values():\n", - " with open(file, 'rb') as f:\n", - " mapping[file] = f.read()\n", - "print(mapping)\n" + "import os\n", + "\n", + "for timestep, filelist in DATA_FILES.items():\n", + " print(timestep)\n", + " print('-----------')\n", + " for file in filelist:\n", + " with open(file, 'rb') as f:\n", + " print(os.path.basename(file), f.read())\n", + " print()" ] } ],