diff --git a/lessons/landlab/landlab/01-intro.ipynb b/lessons/landlab/landlab/01-intro.ipynb index 035a857..65f3af9 100644 --- a/lessons/landlab/landlab/01-intro.ipynb +++ b/lessons/landlab/landlab/01-intro.ipynb @@ -214,6 +214,21 @@ "Now see if you can do something similar with a `HexModelGrid`." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Create a hex grid that has 5 rows and 4 colums of nodes." + ] + }, { "cell_type": "markdown", "metadata": { @@ -226,7 +241,6 @@ " <summary>👉 <b>click to see solution</b></summary>\n", "\n", "```python\n", - "# Create a hex grid that has 5 rows and 4 colums of nodes.\n", "grid = HexModelGrid((5, 4))\n", "plot_graph(grid, at=\"node\")\n", "```\n", @@ -241,6 +255,21 @@ "the correct signature to use." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# create a radial grid instance" + ] + }, { "cell_type": "markdown", "metadata": { @@ -253,7 +282,6 @@ " <summary>👉 <b>click to see solution</b></summary>\n", "\n", "```python\n", - "# create a radial grid instance\n", "grid = RadialModelGrid(5, 4)\n", "plot_graph(grid, at=\"node\")\n", "```\n", @@ -268,6 +296,21 @@ "interior *nodes* have been offset be a random amount." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Create a framed voronoi grid with 4 rows and 5 columns of nodes." + ] + }, { "cell_type": "markdown", "metadata": { @@ -280,7 +323,6 @@ " <summary>👉 <b>click to see solution</b></summary>\n", "\n", "```python\n", - "# Create a framed voronoi grid with 4 rows and 5 columns of nodes.\n", "grid = FramedVoronoiGrid((4, 5))\n", "plot_graph(grid, at=\"node\")\n", "```\n", @@ -316,7 +358,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.3" + "version": "3.11.7" } }, "nbformat": 4, diff --git a/lessons/landlab/landlab/02-data.ipynb b/lessons/landlab/landlab/02-data.ipynb index 1c4de11..cfd78b2 100644 --- a/lessons/landlab/landlab/02-data.ipynb +++ b/lessons/landlab/landlab/02-data.ipynb @@ -2,7 +2,13 @@ "cells": [ { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "<a href=\"http://landlab.github.io\"><img style=\"float: left\" src=\"https://raw.githubusercontent.com/landlab/tutorials/release/landlab_header.png\"></a>" ] @@ -81,9 +87,28 @@ "grid.at_node[\"foo\"]" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Get the values for the field names, \"bar\"" + ] + }, { "cell_type": "markdown", "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, "tags": [ "solution" ] @@ -93,7 +118,6 @@ " <summary>👉 <b>click to see solution</b></summary>\n", "\n", "```python\n", - "# Get the values for the field names, \"bar\"\n", "grid.at_node[\"bar\"]\n", "```\n", "</details>" @@ -146,9 +170,28 @@ "* What are the maximum and minimum elevation values?" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Write your code here" + ] + }, { "cell_type": "markdown", "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, "tags": [ "solution" ] @@ -158,7 +201,6 @@ " <summary>👉 <b>click to see solution</b></summary>\n", "\n", "```python\n", - "# Write your code here\n", "print(f\"Number of points = {grid.number_of_nodes}\")\n", "print(f\"Number of rows and columns = {grid.shape}\")\n", "print(f\"Resolution = {grid.spacing}\")\n", @@ -474,7 +516,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.3" + "version": "3.11.7" } }, "nbformat": 4, diff --git a/lessons/landlab/landlab/03-links-cells.ipynb b/lessons/landlab/landlab/03-links-cells.ipynb index 194fb39..60678a9 100644 --- a/lessons/landlab/landlab/03-links-cells.ipynb +++ b/lessons/landlab/landlab/03-links-cells.ipynb @@ -2,7 +2,13 @@ "cells": [ { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "<a href=\"http://landlab.github.io\"><img style=\"float: left\" src=\"https://raw.githubusercontent.com/landlab/tutorials/release/landlab_header.png\"></a>" ] @@ -34,7 +40,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "from landlab import RasterModelGrid\n", @@ -56,7 +68,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "grid.nodes_at_link" @@ -65,7 +83,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "grid.node_at_link_tail, grid.node_at_link_head" @@ -82,7 +106,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "grid.links_at_node" @@ -90,7 +120,13 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "This data structure demonstrates a couple conventions used by *Landlab* data structures of grid elements.\n", "\n", @@ -119,21 +155,66 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "grid = RasterModelGrid((4, 5), xy_spacing=(1, 0.5))\n", "plot_graph(grid, at=\"node,link\")" ] }, + { + "cell_type": "markdown", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "source": [ + "Plot the cells of the grid you just created." + ] + }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ - "grid = RasterModelGrid((4, 5), xy_spacing=(1, 0.5))\n", - "plot_graph(grid, at=\"cell\")" + "# Plot the cells" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [ + "solution" + ] + }, + "source": [ + "<details>\n", + " <summary>👉 <b>click to see solution</b></summary>\n", + "\n", + "```python\n", + "plot_graph(grid, at=\"cell\")\n", + "```\n", + "</details>" ] }, { @@ -162,7 +243,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.3" + "version": "3.11.7" } }, "nbformat": 4, diff --git a/lessons/landlab/landlab/04-numerics.ipynb b/lessons/landlab/landlab/04-numerics.ipynb index 57446f9..a0b4295 100644 --- a/lessons/landlab/landlab/04-numerics.ipynb +++ b/lessons/landlab/landlab/04-numerics.ipynb @@ -2,7 +2,13 @@ "cells": [ { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "source": [ "<a href=\"http://landlab.github.io\"><img style=\"float: left\" src=\"https://raw.githubusercontent.com/landlab/tutorials/release/landlab_header.png\"></a>" ] @@ -142,7 +148,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "from landlab import RasterModelGrid\n", @@ -170,7 +182,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "D = 0.1\n", @@ -190,7 +208,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "qs = grid.zeros(at=\"link\")\n", @@ -205,7 +229,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "grid.imshow(z, at=\"node\")" @@ -214,7 +244,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", @@ -233,7 +269,13 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, "outputs": [], "source": [ "from landlab import HexModelGrid\n", @@ -241,9 +283,28 @@ "grid = HexModelGrid((32, 32), spacing=1.0, node_layout=\"rect\")" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, + "tags": [] + }, + "outputs": [], + "source": [ + "# Write you diffusion model here" + ] + }, { "cell_type": "markdown", "metadata": { + "editable": true, + "slideshow": { + "slide_type": "" + }, "tags": [ "solution" ] @@ -253,7 +314,6 @@ " <summary>👉 <b>click to see solution</b></summary>\n", "\n", "```python\n", - "# Write you diffusion model here\n", "z = grid.zeros(at=\"node\")\n", "z[grid.y_of_node > 16] = 1.0\n", "\n", @@ -295,7 +355,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.3" + "version": "3.11.7" } }, "nbformat": 4,