Skip to content

Commit

Permalink
Switch to html admonitions in all of the botebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
erogluorhan committed Mar 29, 2024
1 parent f584278 commit 5eb9958
Show file tree
Hide file tree
Showing 10 changed files with 605 additions and 356 deletions.
13 changes: 8 additions & 5 deletions notebooks/01-intro/01-unstructured-grid-overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
},
{
"cell_type": "markdown",
"source": [],
"metadata": {
"collapsed": false
}
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": []
},
{
"cell_type": "markdown",
Expand Down Expand Up @@ -247,7 +250,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-warning\">\n",
"<div class=\"admonition alert alert-info\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Note:</p>\n",
" This is a very basic example of an unstructured grid with triangles. There are very specialized libraries to create\n",
" unstructured grids. Often the region of interest is meshed with a finer resolution. The mesh is then coarsened in\n",
Expand Down Expand Up @@ -283,7 +286,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-warning\">\n",
"<div class=\"admonition alert alert-info\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Note:</p>\n",
" This notebook serves as an introduction to unstructured grids and UXarray. For more information, please visit the\n",
" <a href=\"https://uxarray.readthedocs.io/en/latest/\">UXarray documentation</a> and specifically see the \n",
Expand Down
19 changes: 11 additions & 8 deletions notebooks/02-methods/01-plotting-libraries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-warning\">\n",
"<div class=\"admonition alert alert-info\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Note:</p>\n",
" The following design diagram is actually provided in the <a href=\"../03-uxarray-vis/01-plot-api.ipynb\">Plotting\n",
" API</a> section along with key takeaways about it. We highly recommend to check them out as well.\n",
Expand Down Expand Up @@ -71,7 +71,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition important\" style=\"background: lightgreen>\n",
"<div class=\"admonition alert alert-warning\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Important!</p>\n",
" UXarray takes care of the vital tasks such as recognizing unstructured grids from various formats (such as UGRID,\n",
" MPAS, Scrip, Exodus, etc.) and representing them in a unified UGRID-like format, providing the data structures and\n",
Expand Down Expand Up @@ -105,9 +105,10 @@
"cell_type": "markdown",
"metadata": {},
"source": [
":::{important}\n",
"UXarray allows both Matplotlib and Bokeh backends to be chosen in visualization functions as they are provided by Holoviews (in addition to Plotly).\n",
":::"
"<div class=\"admonition alert alert-info\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Note:</p>\n",
" UXarray allows both Matplotlib and Bokeh backends to be chosen in visualization functions as they are provided by Holoviews (in addition to Plotly).\n",
"</div>"
]
},
{
Expand Down Expand Up @@ -213,9 +214,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
":::{warning}\n",
"While these conversion functions have already been released, we have observed some issues with the resulting Matplotlib plots after the exceution of these functions, and the bug-fixing of that is WIP. Hence, we don't have an officially released documentation/example about these functions yet.\n",
":::"
"<div class=\"admonition alert alert-warning\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Warning!</p>\n",
" While these conversion functions have already been released, we have observed some issues with the resulting Matplotlib plots after the exceution of\n",
" these functions, and the bug-fixing of that is WIP. Hence, we don't have an officially released documentation/example about these functions yet.\n",
"</div>"
]
},
{
Expand Down
147 changes: 102 additions & 45 deletions notebooks/02-methods/02-rendering-techniques.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"## Vector (Shape) Geometries\n",
Expand All @@ -39,7 +42,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"Another example of Vector Geometries is encountered when adding features to a visualization, such as Contents or Borders. The geometries of these features are drawn onto our screen.\n",
Expand All @@ -53,17 +59,23 @@
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"### Shapely Example"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"One Python package which is used for representing and manipulating geometries is [Shapely](https://shapely.readthedocs.io/en/stable/manual.html).\n",
Expand All @@ -77,7 +89,10 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
Expand All @@ -86,58 +101,76 @@
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"A node is represented as a pair of longitude and latitude coordinates"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"sp.Point([0.0, 0.0])"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"An edge is represented as a pair of nodes."
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"sp.LineString([[0.0, 0.0], [180, -90]])"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"A face is represented as a counter-clockwise set of nodes, with the first and final nodes in the set being equivalent (form a closed face)"
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
Expand All @@ -146,15 +179,21 @@
},
{
"cell_type": "markdown",
"source": [],
"metadata": {
"collapsed": false
}
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": []
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"## Rasterization\n",
Expand All @@ -175,7 +214,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"For unstructured grids, rasterization looks something like the following.\n",
Expand All @@ -189,24 +231,39 @@
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"The black edges outline the expected geometry of each face (a.k.a polygon).\n",
"\n",
"We can observe the jaggedness in the shading, which is the product of rasterization approximating each face."
],
"metadata": {
"collapsed": false
}
]
},
{
"cell_type": "markdown",
"source": [
":::{seealso}\n",
"A more comprehensive showcase of rasterization can be found [here](https://learn.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-rasterizer-stage-rules)."
],
"metadata": {
"collapsed": false
}
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"<div class=\"admonition alert alert-info\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">See also:</p>\n",
" A more comprehensive showcase of rasterization can be found <a href=\"https://learn.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-rasterizer-stage-rules\">here</a>\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -225,7 +282,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.12.2"
},
"nbdime-conflicts": {
"local_diff": [
Expand Down
8 changes: 5 additions & 3 deletions notebooks/03-uxarray-vis/01-plot-api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
}
},
"source": [
"```{seealso}\n",
"This notebook acts as an introduction into using the UXarray plotting API. Please refer to the following notebooks in this chapter for a detailed overview of visualization techniques for different purposes (e.g. [Grid Topology](https://projectpythia.org/unstructured-grid-viz-cookbook/notebooks/03-uxarray-vis/02-grid-topology.html), [Polygons](https://projectpythia.org/unstructured-grid-viz-cookbook/notebooks/03-uxarray-vis/03-polygons.html)).\n",
"```"
"<div class=\"admonition alert alert-info\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">See also:</p>\n",
" This notebook acts as an introduction into using the UXarray plotting API. Please refer to the following notebooks in this chapter for a detailed\n",
" overview of visualization techniques for different purposes (e.g. <a href=\"https://projectpythia.org/unstructured-grid-viz-cookbook/notebooks/03-uxarray-vis/02-grid-topology.html\">Grid Topology</a>, <a href=\"https://projectpythia.org/unstructured-grid-viz-cookbook/notebooks/03-uxarray-vis/03-polygons.html\">Polygons</a>\n",
"</div>"
]
},
{
Expand Down
Loading

0 comments on commit 5eb9958

Please sign in to comment.