Automatize Tutorials html, py files creation (#496)

* workflow to export tutorials

---------
This commit is contained in:
Dario Coscia
2025-03-15 11:01:19 +01:00
committed by FilippoOlivo
parent 8dfc9d19db
commit 3ff9f0c9a2
51 changed files with 140529 additions and 440 deletions

View File

@@ -26,21 +26,30 @@
"source": [
"## routine needed to run the notebook on Google Colab\n",
"try:\n",
" import google.colab\n",
" IN_COLAB = True\n",
" import google.colab\n",
"\n",
" IN_COLAB = True\n",
"except:\n",
" IN_COLAB = False\n",
" IN_COLAB = False\n",
"if IN_COLAB:\n",
" !pip install \"pina-mathlab\"\n",
" !pip install \"pina-mathlab\"\n",
"\n",
"import matplotlib.pyplot as plt\n",
"\n",
"from pina.domain import EllipsoidDomain, Difference, CartesianDomain, Union, SimplexDomain, DomainInterface\n",
"from pina.domain import (\n",
" EllipsoidDomain,\n",
" Difference,\n",
" CartesianDomain,\n",
" Union,\n",
" SimplexDomain,\n",
" DomainInterface,\n",
")\n",
"from pina.label_tensor import LabelTensor\n",
"\n",
"\n",
"def plot_scatter(ax, pts, title):\n",
" ax.title.set_text(title)\n",
" ax.scatter(pts.extract('x'), pts.extract('y'), color='blue', alpha=0.5)"
" ax.scatter(pts.extract(\"x\"), pts.extract(\"y\"), color=\"blue\", alpha=0.5)"
]
},
{