Skip to content

Commit

Permalink
fix notebooks in example
Browse files Browse the repository at this point in the history
Signed-off-by: Lance-Drane <[email protected]>
  • Loading branch information
Lance-Drane committed Nov 26, 2024
1 parent 7db99b0 commit f00a2b4
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
22 changes: 17 additions & 5 deletions examples-proposed/004-jupyter-append/sim/input_dir/basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
14 changes: 9 additions & 5 deletions examples-proposed/005-jupyter-replace/sim/input_dir/basic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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()"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()"
]
}
],
Expand Down

0 comments on commit f00a2b4

Please sign in to comment.