Skip to content

Commit

Permalink
Updated exercises
Browse files Browse the repository at this point in the history
  • Loading branch information
ecomodeller committed Aug 16, 2024
1 parent 0e38a21 commit 221ef03
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 37 deletions.
27 changes: 9 additions & 18 deletions mini_book/exercises/exercise_dfsu.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,16 @@
"# Exercise: Dfsu 2D"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# import the Dfsu class "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Read "
"## Open / Read "
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -34,11 +25,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"# create Dfsu object \"dfs\" from fn"
"# create a Dfsu2DH object \"dfs\" from fn using mikeio.open"
]
},
{
Expand All @@ -52,11 +43,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"# does the mesh have any quad elements? "
"# does the mesh (use the .geometry attribute) have any quad elements, or is it triangles only?"
]
},
{
Expand All @@ -83,7 +74,7 @@
"metadata": {},
"outputs": [],
"source": [
"# get an array of max wind speed per timestep (hint: use the max(axis=1) on ds) "
"# get an array of max wind speed per timestep (hint: use the max(axis=1) on ds)"
]
},
{
Expand Down Expand Up @@ -119,7 +110,7 @@
"outputs": [],
"source": [
"# rename the first and only item of this dataset (Surface elevation) to `Sea Level`\n",
"# ds.items[0].name = \"new name\""
"# (hint: use the .rename method on the dataset)"
]
},
{
Expand Down Expand Up @@ -162,7 +153,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.10.12"
},
"orig_nbformat": 4
},
Expand Down
29 changes: 10 additions & 19 deletions mini_book/exercises/exercise_mesh.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@
"# Exercise: Mesh"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# import the Mesh class"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -25,11 +16,11 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"fn = \"../data/three_elements.mesh\""
"fn = \"../data/two_elements.mesh\""
]
},
{
Expand All @@ -38,12 +29,12 @@
"metadata": {},
"outputs": [],
"source": [
"# load the mesh to a variable msh"
"# load the mesh to a variable msh using mikeio.open"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -56,7 +47,7 @@
"metadata": {},
"outputs": [],
"source": [
"# determine the cell center coordinates for the three elements"
"# determine the cell center coordinates for the two elements"
]
},
{
Expand All @@ -77,7 +68,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -99,16 +90,16 @@
"metadata": {},
"outputs": [],
"source": [
"# plot the mesh boundary"
"# plot the mesh boundary nodes"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 20,
"metadata": {},
"outputs": [],
"source": [
"# check if the point p1 is inside the mesh\n",
"# check if the point p1 is inside the mesh (use the .geometry attribute)\n",
"p1 = [4.8674, 53.2126]"
]
},
Expand Down Expand Up @@ -149,7 +140,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
"version": "3.10.12"
},
"orig_nbformat": 4
},
Expand Down

0 comments on commit 221ef03

Please sign in to comment.