mirror of
https://github.com/ArthurDanjou/ArtStudies.git
synced 2026-01-14 15:54:13 +01:00
Refactor error messages and function signatures across multiple notebooks for clarity and consistency
- Updated error messages in Gauss method and numerical methods to use variables for better readability. - Added return type hints to function signatures in various notebooks to improve code documentation. - Corrected minor grammatical issues in docstrings for better clarity. - Adjusted print statements and list concatenations for improved output formatting. - Enhanced plotting functions to ensure consistent figure handling.
This commit is contained in:
@@ -381,7 +381,7 @@
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"def plot_maze_with_states():\n",
|
||||
"def plot_maze_with_states() -> None:\n",
|
||||
" \"\"\"Plot the maze with state indices.\"\"\"\n",
|
||||
" grid = np.ones(\n",
|
||||
" (n_rows, n_cols),\n",
|
||||
@@ -391,7 +391,7 @@
|
||||
" if maze_str[i][j] == \"#\":\n",
|
||||
" grid[i, j] = 0 # We replace walls (#) with 0\n",
|
||||
"\n",
|
||||
" fig, ax = plt.subplots()\n",
|
||||
" _fig, ax = plt.subplots()\n",
|
||||
" ax.imshow(grid, cmap=\"gray\", alpha=0.7)\n",
|
||||
"\n",
|
||||
" # Plot state indices\n",
|
||||
@@ -1142,7 +1142,7 @@
|
||||
" ] # For each reachable cell, we write the value V[s] in the grid.\n",
|
||||
" # Walls # never get values, and they stay as NaN.\n",
|
||||
"\n",
|
||||
" fig, ax = plt.subplots()\n",
|
||||
" _fig, ax = plt.subplots()\n",
|
||||
" im = ax.imshow(grid_values, cmap=\"magma\")\n",
|
||||
" plt.colorbar(im, ax=ax)\n",
|
||||
"\n",
|
||||
|
||||
Reference in New Issue
Block a user