Skip to content

Commit

Permalink
Ignore empty data
Browse files Browse the repository at this point in the history
  • Loading branch information
TLCFEM committed Dec 30, 2024
1 parent 9f18480 commit 7705c09
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions docs/Library/Section/Code/Validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -70,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 25,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -111,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": 26,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -137,7 +137,7 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -162,7 +162,7 @@
},
{
"cell_type": "code",
"execution_count": 28,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -202,17 +202,26 @@
" k: v for k, v in all_results.items() if not k.startswith(\"HSS\") and \"T\" in k\n",
"}\n",
"\n",
"total = 3 * (\n",
" int(bool(rhs_results))\n",
" + int(bool(chs_results))\n",
" + int(bool(i_results))\n",
" + int(bool(t_results))\n",
")\n",
"\n",
"counter = 0\n",
"\n",
"\n",
"def plot(title, index, results):\n",
" if not results:\n",
" return\n",
" values = [x[index] for x in results.values()]\n",
" min_value = min(values)\n",
" max_value = max(values)\n",
" colors = [\"red\" if abs(x - 1) > 0.05 else \"green\" for x in values]\n",
" global counter\n",
" counter += 1\n",
" ax = fig.add_subplot(12, 1, counter)\n",
" ax = fig.add_subplot(total, 1, counter)\n",
" ax.bar(results.keys(), values, color=colors)\n",
" ax.set_ylabel(\"Numerical/Analytical\")\n",
" ax.set_xlabel(\"Section\")\n",
Expand Down Expand Up @@ -271,7 +280,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -284,13 +293,15 @@
"source": [
"The figures can be downloaded: [us](../US.pdf).\n",
"\n",
"## Automation Utilities\n",
"\n",
"The following is the script to generate autocompletion.\n",
"Readers can safely ignore."
"Readers can safely ignore it."
]
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -330,7 +341,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -414,7 +425,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.10.15"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 7705c09

Please sign in to comment.