From af607544b5afedee6db3b44ae02d6eb0f3ee8ab8 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 6 May 2025 20:32:28 -0700 Subject: [PATCH 1/9] update links, minor edits to welcome notebook --- lessons/landlab/landlab/00_welcome.ipynb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lessons/landlab/landlab/00_welcome.ipynb b/lessons/landlab/landlab/00_welcome.ipynb index 2b0ffdf..59a886f 100644 --- a/lessons/landlab/landlab/00_welcome.ipynb +++ b/lessons/landlab/landlab/00_welcome.ipynb @@ -16,11 +16,11 @@ "Landlab is an open-source Python-language package for numerical modeling of Earth surface dynamics.\n", "It contains:\n", "\n", - "* A gridding engine which represents the model domain. Regular and irregular grids are supported.\n", - "* A library of process components, each of which represents a physical process (e.g., generation\n", + "* A **gridding engine** that represents the model domain. Regular and irregular grids are supported.\n", + "* A **library of process components**, each of which represents a physical process (e.g., generation\n", " of rain, erosion by flowing water). These components have a common interface and can be combined\n", " based on a user's needs.\n", - "* Utilities that support general numerical methods, file input/output, and visualization.\n" + "* Utilities that support general **numerical methods**, file **input/output**, and **visualization**.\n" ] }, { @@ -42,7 +42,7 @@ " * Grid elements: *cells*\n", " \n", "* [Numerics](04-numerics.ipynb)\n", - " * Calculations on a grid elements\n", + " * Calculations on grid elements\n", " * Example: Fault scarp\n", "\n", "* [Components](05-components.ipynb)\n", @@ -54,10 +54,10 @@ "* [HyLands demo](bedrock_landslides_on_dems.ipynb)\n", "* [Overland flow](overland_flow.ipynb)\n", " * This notebook illustrates running the deAlmeida overland flow component in an extremely\n", - " simple-minded way on a real topography, then shows it creating a flood sequence along\n", + " simple-minded way on real topography, it then shows how to create a flood sequence along\n", " an inclined surface with an oscillating water surface at one end.\n", "\n", - "**For more Landlab tutorials, click here:** https://landlab.readthedocs.io/en/latest/user_guide/tutorials.html\n" + "For more Landlab tutorials, see the [Tutorial Gallery](https://landlab.csdms.io/generated/tutorials)\n" ] }, { @@ -67,12 +67,20 @@ "## Links\n", "\n", "* Reference\n", - " * [Documentation](https://landlab.readthedocs.io)\n", + " * [Documentation](https://landlab.csdms.io)\n", + " * [Tutorial Gallery](https://landlab.csdms.io/generated/tutorials)\n", " * [Source code](https://github.com/landlab/landlab)\n", "* Ask for help\n", " * [Issues on GitHub](https://github.com/csdms/landlab/issues)\n", " * [CSDMS Help Desk](https://csdms.github.io/help-desk)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "👉 [Introduction to grids](01-intro.ipynb)" + ] } ], "metadata": { From 3b9dc3e729b03f8f2c556a39029cf15e9690153f Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 6 May 2025 20:34:04 -0700 Subject: [PATCH 2/9] update link to docs; highlight sketchbook in intro notebook --- lessons/landlab/landlab/01-intro.a.ipynb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lessons/landlab/landlab/01-intro.a.ipynb b/lessons/landlab/landlab/01-intro.a.ipynb index 3028fae..ac8e6b5 100644 --- a/lessons/landlab/landlab/01-intro.a.ipynb +++ b/lessons/landlab/landlab/01-intro.a.ipynb @@ -63,7 +63,6 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "\n", "## What you need to know about Landlab grids\n", "\n", "Landlab model grids are 2D data structures that represent the model domain. A few things to know about grid management:\n", @@ -80,9 +79,14 @@ "\n", "\n", "\n", - "**Figure** Geometry and topology of grid elements on various Landlab grids ([Hobley et al. 2017](https://esurf.copernicus.org/articles/5/21/2017/))\n", - "\n", - "-- [Interactive sketchbook](https://landlab.github.io/grid-sketchbook/)" + "**Figure** Geometry and topology of grid elements on various Landlab grids ([Hobley et al. 2017](https://esurf.copernicus.org/articles/5/21/2017/))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 👉 [Interactive sketchbook](https://landlab.github.io/grid-sketchbook/)" ] }, { @@ -113,7 +117,7 @@ "\n", "---\n", "\n", - "**More complete descriptions of these grid types can be found in [Landlab's documentation](https://landlab.readthedocs.io/en/master/user_guide/grid.html).**\n", + "**More complete descriptions of these grid types can be found in [Landlab's documentation](https://landlab.csdms.io/user_guide/reference/grid.html)**\n", "\n", "---" ] @@ -132,7 +136,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "These are all Python classes, and the instances we create of those classes will be our grid objects. For starters, we'll get some basic information on `RasterModelGrid`. Then we'll create an instance of the class `RasterModelGrid` with 3 rows, 4 columns, and 10-unit grid spacing." + "These are all Python classes, and the instances we create of those classes will be our grid objects. For starters, we'll get some basic information on `RasterModelGrid`. Then we'll create an instance of the class `RasterModelGrid` with 4 rows, 5 columns, and 10.0-unit grid spacing in the *x* (column) direction and 5.0 in the *y* (row) direction." ] }, { @@ -150,7 +154,7 @@ "source": [ "#### Nodes\n", "\n", - "*nodes* are simply points that have *x* and *y* coordinates. Different grid types simply lay out\n", + "*nodes* are simply points that have *x* and *y* coordinates. Different grid types lay out\n", "*nodes* in different ways.\n", "\n", "Below we create a `RasterModelGrid` that has four rows and 5 columns of nodes." From 00b468ccded0204e3e905748eef3dbf2b1201b73 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 6 May 2025 20:43:59 -0700 Subject: [PATCH 3/9] sync intro notebook --- lessons/landlab/landlab/01-intro.ipynb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lessons/landlab/landlab/01-intro.ipynb b/lessons/landlab/landlab/01-intro.ipynb index 65f3af9..dd25a2c 100644 --- a/lessons/landlab/landlab/01-intro.ipynb +++ b/lessons/landlab/landlab/01-intro.ipynb @@ -63,7 +63,6 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "\n", "## What you need to know about Landlab grids\n", "\n", "Landlab model grids are 2D data structures that represent the model domain. A few things to know about grid management:\n", @@ -80,9 +79,14 @@ "\n", "\n", "\n", - "**Figure** Geometry and topology of grid elements on various Landlab grids ([Hobley et al. 2017](https://esurf.copernicus.org/articles/5/21/2017/))\n", - "\n", - "-- [Interactive sketchbook](https://landlab.github.io/grid-sketchbook/)" + "**Figure** Geometry and topology of grid elements on various Landlab grids ([Hobley et al. 2017](https://esurf.copernicus.org/articles/5/21/2017/))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 👉 [Interactive sketchbook](https://landlab.github.io/grid-sketchbook/)" ] }, { @@ -113,7 +117,7 @@ "\n", "---\n", "\n", - "**More complete descriptions of these grid types can be found in [Landlab's documentation](https://landlab.readthedocs.io/en/master/user_guide/grid.html).**\n", + "**More complete descriptions of these grid types can be found in [Landlab's documentation](https://landlab.csdms.io/user_guide/reference/grid.html)**\n", "\n", "---" ] @@ -132,7 +136,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "These are all Python classes, and the instances we create of those classes will be our grid objects. For starters, we'll get some basic information on `RasterModelGrid`. Then we'll create an instance of the class `RasterModelGrid` with 3 rows, 4 columns, and 10-unit grid spacing." + "These are all Python classes, and the instances we create of those classes will be our grid objects. For starters, we'll get some basic information on `RasterModelGrid`. Then we'll create an instance of the class `RasterModelGrid` with 4 rows, 5 columns, and 10.0-unit grid spacing in the *x* (column) direction and 5.0 in the *y* (row) direction." ] }, { @@ -150,7 +154,7 @@ "source": [ "#### Nodes\n", "\n", - "*nodes* are simply points that have *x* and *y* coordinates. Different grid types simply lay out\n", + "*nodes* are simply points that have *x* and *y* coordinates. Different grid types lay out\n", "*nodes* in different ways.\n", "\n", "Below we create a `RasterModelGrid` that has four rows and 5 columns of nodes." From 6559c8b123bb2acdea0648837129a9bcc2ecf05b Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 6 May 2025 20:35:37 -0700 Subject: [PATCH 4/9] use new esri_ascii.load function in data notebook --- lessons/landlab/landlab/02-data.a.ipynb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lessons/landlab/landlab/02-data.a.ipynb b/lessons/landlab/landlab/02-data.a.ipynb index 167e8ce..bdc4b76 100644 --- a/lessons/landlab/landlab/02-data.a.ipynb +++ b/lessons/landlab/landlab/02-data.a.ipynb @@ -140,9 +140,11 @@ "metadata": {}, "outputs": [], "source": [ - "from landlab.io import read_esri_ascii\n", + "from landlab.io import esri_ascii\n", "\n", - "(grid, z) = read_esri_ascii(\"data/square-test-basin.asc\", name=\"topographic__elevation\")" + "with open(\"data/square-test-basin.asc\") as stream:\n", + " grid = esri_ascii.load(stream, name=\"topographic__elevation\")\n", + "z = grid.at_node[\"topographic__elevation\"]" ] }, { @@ -321,7 +323,7 @@ "metadata": {}, "outputs": [], "source": [ - "?Topography" + "help(Topography)" ] }, { From 7abe0c052362d1b70095aba95fa217655940a203 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 6 May 2025 20:44:23 -0700 Subject: [PATCH 5/9] sync data notebook --- lessons/landlab/landlab/02-data.ipynb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lessons/landlab/landlab/02-data.ipynb b/lessons/landlab/landlab/02-data.ipynb index b40f987..eb292b8 100644 --- a/lessons/landlab/landlab/02-data.ipynb +++ b/lessons/landlab/landlab/02-data.ipynb @@ -144,9 +144,11 @@ "metadata": {}, "outputs": [], "source": [ - "from landlab.io import read_esri_ascii\n", + "from landlab.io import esri_ascii\n", "\n", - "(grid, z) = read_esri_ascii(\"data/square-test-basin.asc\", name=\"topographic__elevation\")" + "with open(\"data/square-test-basin.asc\") as stream:\n", + " grid = esri_ascii.load(stream, name=\"topographic__elevation\")\n", + "z = grid.at_node[\"topographic__elevation\"]" ] }, { @@ -329,7 +331,7 @@ "metadata": {}, "outputs": [], "source": [ - "?Topography" + "help(Topography)" ] }, { From 57721fe196b56860d815e2366f69d93c55ee95ed Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 6 May 2025 20:37:11 -0700 Subject: [PATCH 6/9] add link from numericcs to components notebook --- lessons/landlab/landlab/04-numerics.a.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lessons/landlab/landlab/04-numerics.a.ipynb b/lessons/landlab/landlab/04-numerics.a.ipynb index 6cd31d9..49b7925 100644 --- a/lessons/landlab/landlab/04-numerics.a.ipynb +++ b/lessons/landlab/landlab/04-numerics.a.ipynb @@ -331,6 +331,13 @@ "\n", "grid.imshow(z)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "👉 [Components](05-components.ipynb)" + ] } ], "metadata": { From d78e70bf0132e7c76fa1ec6744bead90f6ea5cbc Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 6 May 2025 20:44:48 -0700 Subject: [PATCH 7/9] sync numerics notebook --- lessons/landlab/landlab/04-numerics.ipynb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lessons/landlab/landlab/04-numerics.ipynb b/lessons/landlab/landlab/04-numerics.ipynb index a0b4295..2e82aef 100644 --- a/lessons/landlab/landlab/04-numerics.ipynb +++ b/lessons/landlab/landlab/04-numerics.ipynb @@ -335,6 +335,13 @@ "```\n", "" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "👉 [Components](05-components.ipynb)" + ] } ], "metadata": { From 2ba6682664b208af38edb24731a1a4aa05e03b88 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 6 May 2025 20:38:15 -0700 Subject: [PATCH 8/9] fix some formatting in the components notebook --- lessons/landlab/landlab/05-components.a.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lessons/landlab/landlab/05-components.a.ipynb b/lessons/landlab/landlab/05-components.a.ipynb index 533210a..102e5de 100644 --- a/lessons/landlab/landlab/05-components.a.ipynb +++ b/lessons/landlab/landlab/05-components.a.ipynb @@ -18,7 +18,8 @@ "Component modeling is a bit like the potluck tradition: one can construct a complete simulation by assembling components to represent the different parts of the system to be modeled. In Landlab, a **component** is a semi-standardized Python *class* that represents a particular process or calculation. Components are not stand-alone programs, but rather are designed to be used within another Python program that creates an integrated model or workflow.\n", "\n", "\n", - "*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*\n" + "\n", + "*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*" ] }, { @@ -46,6 +47,7 @@ }, "source": [ "\n", + "\n", "*Figure 3: cumulative infiltration water depth during a simulated five-minute heavy rainfall (from Landlab tutorial \"Green-Ampt infiltration and kinematic wave overland flow\")*\n", "\n", "The following code snippets illustrate how the components are imported...\n", From ffc6ae7a02ab6aef884236f2ddd6f4402b87d754 Mon Sep 17 00:00:00 2001 From: mcflugen Date: Tue, 6 May 2025 20:45:20 -0700 Subject: [PATCH 9/9] sync components notebook --- lessons/landlab/landlab/05-components.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lessons/landlab/landlab/05-components.ipynb b/lessons/landlab/landlab/05-components.ipynb index 759bece..900a215 100644 --- a/lessons/landlab/landlab/05-components.ipynb +++ b/lessons/landlab/landlab/05-components.ipynb @@ -18,7 +18,8 @@ "Component modeling is a bit like the potluck tradition: one can construct a complete simulation by assembling components to represent the different parts of the system to be modeled. In Landlab, a **component** is a semi-standardized Python *class* that represents a particular process or calculation. Components are not stand-alone programs, but rather are designed to be used within another Python program that creates an integrated model or workflow.\n", "\n", "\n", - "*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*\n" + "\n", + "*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*" ] }, { @@ -46,6 +47,7 @@ }, "source": [ "\n", + "\n", "*Figure 3: cumulative infiltration water depth during a simulated five-minute heavy rainfall (from Landlab tutorial \"Green-Ampt infiltration and kinematic wave overland flow\")*\n", "\n", "The following code snippets illustrate how the components are imported...\n",