aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam Janovsky2024-09-19 13:56:45 -0700
committerAdam Janovsky2024-09-19 13:56:45 -0700
commitf4b6f8977db9363ff5a8abd97a641f24e83d01ac (patch)
tree32466d464487eab909a406af07ed123a7a740eba
parent3f88f7679fd62519abb4bed4f0189e22c442ee66 (diff)
downloadsec-certs-f4b6f8977db9363ff5a8abd97a641f24e83d01ac.tar.gz
sec-certs-f4b6f8977db9363ff5a8abd97a641f24e83d01ac.tar.zst
sec-certs-f4b6f8977db9363ff5a8abd97a641f24e83d01ac.zip
add notebook with icmc 2024 presentation plots
-rw-r--r--notebooks/fips/icmc_plots.ipynb168
1 files changed, 168 insertions, 0 deletions
diff --git a/notebooks/fips/icmc_plots.ipynb b/notebooks/fips/icmc_plots.ipynb
new file mode 100644
index 00000000..9f2090d4
--- /dev/null
+++ b/notebooks/fips/icmc_plots.ipynb
@@ -0,0 +1,168 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import re\n",
+ "from pathlib import Path\n",
+ "\n",
+ "import matplotlib.pyplot as plt\n",
+ "import numpy as np\n",
+ "import pandas as pd\n",
+ "import seaborn as sns\n",
+ "\n",
+ "from sec_certs.dataset import FIPSDataset\n",
+ "\n",
+ "sns.set_theme(context=\"notebook\", style=\"ticks\", palette=\"Set2\")\n",
+ "\n",
+ "RESULTS_DIR = Path(\"./results/icmc\")\n",
+ "RESULTS_DIR.mkdir(exist_ok=True)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "dataset = FIPSDataset.from_web_latest()\n",
+ "print(f\"The loaded FIPSDataset contains {len(dataset)} certificates\")\n",
+ "df = dataset.to_pandas().loc[lambda _df: _df[\"name\"].notna()]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Create new figure\n",
+ "fig = plt.figure(figsize=(4, 3))\n",
+ "\n",
+ "dfg = df.groupby([\"year_from\", \"standard\"], observed=True).size().reset_index(name=\"n_modules\")\n",
+ "sns.lineplot(data=dfg.loc[dfg.year_from < 2024], x=\"year_from\", y=\"n_modules\", hue=\"standard\", marker=\"o\")\n",
+ "\n",
+ "plt.xlim(1995, 2025)\n",
+ "plt.xlabel(\"Year\")\n",
+ "plt.ylabel(\"Number of certified modules\")\n",
+ "plt.legend(title=\"\")\n",
+ "plt.tight_layout()\n",
+ "\n",
+ "plt.savefig(RESULTS_DIR / \"n_certs_by_standard.pdf\", bbox_inches=\"tight\", dpi=300)\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "fig = plt.figure(figsize=(6, 4))\n",
+ "\n",
+ "dfg = df.groupby([\"year_from\", \"type\"], observed=True).size().reset_index(name=\"n_modules\")\n",
+ "sns.lineplot(data=dfg.loc[dfg.year_from < 2024], x=\"year_from\", y=\"n_modules\", hue=\"type\", marker=\"o\")\n",
+ "\n",
+ "plt.xlim(1995, 2025)\n",
+ "plt.xlabel(\"Year\")\n",
+ "plt.ylabel(\"Number of certified modules\")\n",
+ "plt.legend(title=\"\")\n",
+ "\n",
+ "plt.tight_layout()\n",
+ "plt.savefig(RESULTS_DIR / \"n_certs_by_type.pdf\", bbox_inches=\"tight\", dpi=300)\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "fig = plt.figure(figsize=(4, 3))\n",
+ "\n",
+ "dfg = df.groupby([\"year_from\", \"level\"], observed=True).size().reset_index(name=\"n_modules\")\n",
+ "sns.lineplot(\n",
+ " data=dfg.loc[dfg.year_from < 2024], x=\"year_from\", y=\"n_modules\", hue=\"level\", marker=\"o\", palette=\"viridis\"\n",
+ ")\n",
+ "\n",
+ "plt.xlim(1995, 2025)\n",
+ "plt.xlabel(\"Year\")\n",
+ "plt.ylabel(\"Number of certified modules\")\n",
+ "plt.legend(title=\"Level\")\n",
+ "\n",
+ "plt.savefig(RESULTS_DIR / \"n_certs_by_level.pdf\", bbox_inches=\"tight\", dpi=300)\n",
+ "plt.tight_layout()\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# Average security level\n",
+ "fig = plt.figure(figsize=(4, 3))\n",
+ "\n",
+ "dfg = df.groupby(\"year_from\").agg({\"level\": \"mean\"}).reset_index()\n",
+ "sns.lineplot(data=dfg.loc[dfg.year_from < 2024], x=\"year_from\", y=\"level\", marker=\"o\")\n",
+ "\n",
+ "plt.xlim(1995, 2025)\n",
+ "plt.xlabel(\"Year\")\n",
+ "plt.ylabel(\"Average security level\")\n",
+ "\n",
+ "plt.savefig(RESULTS_DIR / \"avg_sec_level.pdf\", bbox_inches=\"tight\", dpi=300)\n",
+ "plt.tight_layout()\n",
+ "plt.show()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "fig = plt.figure(figsize=(5, 4))\n",
+ "\n",
+ "dfg = df.groupby([\"year_from\", \"embodiment\"], observed=True).size().reset_index(name=\"n_modules\")\n",
+ "sns.lineplot(\n",
+ " data=dfg.loc[dfg.year_from < 2024], x=\"year_from\", y=\"n_modules\", hue=\"embodiment\", marker=\"o\", palette=\"viridis\"\n",
+ ")\n",
+ "\n",
+ "plt.xlim(1995, 2025)\n",
+ "plt.xlabel(\"Year\")\n",
+ "plt.ylabel(\"Number of certified modules\")\n",
+ "plt.legend(title=\"Embodiment\")\n",
+ "\n",
+ "plt.savefig(RESULTS_DIR / \"n_certs_by_embodiment.pdf\", bbox_inches=\"tight\", dpi=300)\n",
+ "plt.tight_layout()\n",
+ "plt.show()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "venv",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.10.14"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}