diff --git a/docs/notebooks/structural_reliability.ipynb b/docs/notebooks/structural_reliability.ipynb index 1f0ec14..2a4b4af 100644 --- a/docs/notebooks/structural_reliability.ipynb +++ b/docs/notebooks/structural_reliability.ipynb @@ -12,32 +12,35 @@ }, { "cell_type": "code", + "execution_count": 10, "id": "cedd5ec9-31f7-4e7f-91be-f73b1d1d00f1", "metadata": { - "scrolled": true, "ExecuteTime": { "end_time": "2024-05-30T09:06:58.579066Z", "start_time": "2024-05-30T09:06:58.552735Z" - } + }, + "scrolled": true }, + "outputs": [], "source": [ "import pathlib\n", "\n", "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "import simdec as sd" - ], - "outputs": [], - "execution_count": 1 + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "Let's first load the dataset. It's a CSV file, each row represent a simulation or sample. The first column is the output or quantity of interest and other columns are parameters' values.", - "id": "8700ed278bb1c06d" + "id": "8700ed278bb1c06d", + "metadata": {}, + "source": [ + "Let's first load the dataset. It's a CSV file, each row represent a simulation or sample. The first column is the output or quantity of interest and other columns are parameters' values." + ] }, { "cell_type": "code", + "execution_count": 11, "id": "0b21846d-edff-4e39-a423-b247f81c4520", "metadata": { "ExecuteTime": { @@ -45,25 +48,9 @@ "start_time": "2024-05-30T09:06:58.579870Z" } }, - "source": [ - "fname = pathlib.Path(\"../../tests/data/stress.csv\")\n", - "\n", - "data = pd.read_csv(fname)\n", - "output_name, *inputs_names = list(data.columns)\n", - "inputs, output = data[inputs_names], data[output_name]\n", - "inputs.head()" - ], "outputs": [ { "data": { - "text/plain": [ - " Kf sigma_res Rp0.2 R\n", - "0 2.454866 -84.530638 297.406169 -0.834480\n", - "1 2.774116 347.586947 379.499452 -0.131827\n", - "2 2.504617 946.567040 940.477667 -0.039126\n", - "3 2.466723 74.222224 406.622486 0.440311\n", - "4 2.615602 -32.937734 979.498038 0.419690" - ], "text/html": [ "
\n", "\n", - "\n", + "
\n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -478,119 +482,133 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", "
  colourstdminmeanmaxprobabilitycolourstdminmeanmaxprobability
sigma_res
lowlow995.3411.19282.08460.070.19lowlow984.7311.74226.72397.620.11
medium887.7667.53407.79622.350.12medium882.6511.19385.26619.780.11
high7108.03237.13541.32819.410.26high7101.23384.75567.44817.840.11
mediumlow634.92350.30434.90523.840.09mediumlow643.37268.77376.10515.250.11
medium544.39398.42485.72650.980.06medium563.56318.15485.57711.720.11
high475.80414.21534.19814.430.11high4106.22420.61580.03819.410.11
highlow335.43630.24703.90794.810.06highlow3132.84383.11576.80794.810.11
medium233.95656.34725.15816.480.04medium2129.07410.77611.25824.870.11
high139.51668.50755.65851.000.08high1127.28448.85643.91851.000.11
\n" + ], + "text/plain": [ + "" ] }, - "execution_count": 9, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], - "execution_count": 9 + "source": [ + "table, styler = sd.tableau(\n", + " statistic=res.statistic,\n", + " var_names=res.var_names,\n", + " states=res.states,\n", + " bins=res.bins,\n", + " palette=palette,\n", + ")\n", + "styler" + ] }, { - "metadata": {}, "cell_type": "markdown", - "source": "Congratulations, now you know how to use SimDec to get more insights on your problem!", - "id": "3cdf58c4bd3dbbca" + "id": "3cdf58c4bd3dbbca", + "metadata": {}, + "source": [ + "Congratulations, now you know how to use SimDec to get more insights on your problem!" + ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -604,7 +622,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.1" + "version": "3.11.14" } }, "nbformat": 4, diff --git a/panel/index.html b/panel/index.html index 52dda01..9cc0ffc 100644 --- a/panel/index.html +++ b/panel/index.html @@ -203,34 +203,36 @@ -
+