Skip to content

Commit

Permalink
name arguments for the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
otvam committed Jan 20, 2025
1 parent 0752afa commit b6d165c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
32 changes: 20 additions & 12 deletions examples/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"\n",
"# get the example filenames\n",
"folder_out = os.path.join(folder_example)\n",
"file_mesher = os.path.join(folder_example, \"geometry.yaml\")\n",
"file_geometry = os.path.join(folder_example, \"geometry.yaml\")\n",
"file_problem = os.path.join(folder_example, \"problem.yaml\")\n",
"file_voxel = os.path.join(folder_example, \"voxel.json.gz\")\n",
"file_solution = os.path.join(folder_example, \"solution.json.gz\")\n",
Expand All @@ -97,7 +97,7 @@
"\n",
"# check the output folder and input files\n",
"assert os.path.isdir(folder_out), \"output folder does not exist\"\n",
"assert os.path.isfile(file_mesher), \"mesher file is not found\"\n",
"assert os.path.isfile(file_geometry), \"geometry file is not found\"\n",
"assert os.path.isfile(file_problem), \"problem file is not found\"\n",
"assert os.path.isfile(file_tolerance), \"tolerance file is not found\"\n",
"assert os.path.isfile(file_viewer), \"viewer file is not found\"\n",
Expand All @@ -121,8 +121,8 @@
"source": [
"# run the mesher\n",
"pypeec.run_mesher_file(\n",
" file_mesher,\n",
" file_voxel,\n",
" file_geometry=file_geometry,\n",
" file_voxel=file_voxel,\n",
")\n",
"\n",
"# load the results\n",
Expand All @@ -149,8 +149,8 @@
"\n",
"# run the viewer\n",
"pypeec.run_viewer_file(\n",
" file_voxel,\n",
" file_viewer,\n",
" file_voxel=file_voxel,\n",
" file_viewer=file_viewer,\n",
" tag_plot=tag_plot,\n",
" plot_mode=plot_mode,\n",
")"
Expand All @@ -173,10 +173,10 @@
"source": [
"# run the solver\n",
"pypeec.run_solver_file(\n",
" file_voxel,\n",
" file_problem,\n",
" file_tolerance,\n",
" file_solution,\n",
" file_voxel=file_voxel,\n",
" file_problem=file_problem,\n",
" file_tolerance=file_tolerance,\n",
" file_solution=file_solution,\n",
")\n",
"\n",
"# load the results\n",
Expand All @@ -203,12 +203,20 @@
"\n",
"# run the plotter\n",
"pypeec.run_plotter_file(\n",
" file_solution,\n",
" file_plotter,\n",
" file_solution=file_solution,\n",
" file_plotter=file_plotter,\n",
" tag_plot=tag_plot,\n",
" plot_mode=plot_mode,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9cc95c59-74ce-4419-bb23-7ec6b8b4c5d6",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
5 changes: 4 additions & 1 deletion examples/run_mesher.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
file_voxel = os.path.join(PATH_ROOT, FOLDER_EXAMPLE, "voxel.json.gz")

# run
pypeec.run_mesher_file(file_geometry, file_voxel)
pypeec.run_mesher_file(
file_geometry=file_geometry,
file_voxel=file_voxel,
)
4 changes: 2 additions & 2 deletions examples/run_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

# run
pypeec.run_plotter_file(
file_solution,
file_plotter,
file_solution=file_solution,
file_plotter=file_plotter,
tag_plot=tag_plot,
)
7 changes: 6 additions & 1 deletion examples/run_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@
file_tolerance = os.path.join(PATH_ROOT, FOLDER_CONFIG, "tolerance.yaml")

# run
pypeec.run_solver_file(file_voxel, file_problem, file_tolerance, file_solution)
pypeec.run_solver_file(
file_voxel=file_voxel,
file_problem=file_problem,
file_tolerance=file_tolerance,
file_solution=file_solution,
)
4 changes: 2 additions & 2 deletions examples/run_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

# run viewer
pypeec.run_viewer_file(
file_voxel,
file_viewer,
file_voxel=file_voxel,
file_viewer=file_viewer,
tag_plot=tag_plot,
)

0 comments on commit b6d165c

Please sign in to comment.