Skip to content

Commit

Permalink
add placeholder cells for answers
Browse files Browse the repository at this point in the history
  • Loading branch information
mcflugen committed Jan 25, 2024
1 parent 7fb82a9 commit 150f090
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 27 deletions.
50 changes: 46 additions & 4 deletions lessons/landlab/landlab/01-intro.a.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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": "code",
"execution_count": null,
Expand All @@ -224,7 +239,6 @@
},
"outputs": [],
"source": [
"# Create a hex grid that has 5 rows and 4 colums of nodes.\n",
"grid = HexModelGrid((5, 4))\n",
"plot_graph(grid, at=\"node\")"
]
Expand All @@ -237,6 +251,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": "code",
"execution_count": null,
Expand All @@ -247,7 +276,6 @@
},
"outputs": [],
"source": [
"# create a radial grid instance\n",
"grid = RadialModelGrid(5, 4)\n",
"plot_graph(grid, at=\"node\")"
]
Expand All @@ -260,6 +288,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": "code",
"execution_count": null,
Expand All @@ -270,7 +313,6 @@
},
"outputs": [],
"source": [
"# Create a framed voronoi grid with 4 rows and 5 columns of nodes.\n",
"grid = FramedVoronoiGrid((4, 5))\n",
"plot_graph(grid, at=\"node\")"
]
Expand Down Expand Up @@ -304,7 +346,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
50 changes: 46 additions & 4 deletions lessons/landlab/landlab/02-data.a.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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>"
]
Expand Down Expand Up @@ -85,13 +91,31 @@
"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": "code",
"execution_count": null,
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"solution"
]
},
"outputs": [],
"source": [
"# Get the values for the field names, \"bar\"\n",
"grid.at_node[\"bar\"]"
]
},
Expand Down Expand Up @@ -146,13 +170,31 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"# Write your code here"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"solution"
]
},
"outputs": [],
"source": [
"# 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",
Expand Down Expand Up @@ -462,7 +504,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
97 changes: 87 additions & 10 deletions lessons/landlab/landlab/03-links-cells.a.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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>"
]
Expand Down Expand Up @@ -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",
Expand All @@ -56,7 +68,13 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"grid.nodes_at_link"
Expand All @@ -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"
Expand All @@ -82,15 +106,27 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"grid.links_at_node"
]
},
{
"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",
Expand Down Expand Up @@ -119,20 +155,61 @@
{
"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": [
"# Plot the cells"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"solution"
]
},
"outputs": [],
"source": [
"grid = RasterModelGrid((4, 5), xy_spacing=(1, 0.5))\n",
"plot_graph(grid, at=\"cell\")"
]
},
Expand Down Expand Up @@ -162,7 +239,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.11.7"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 150f090

Please sign in to comment.