Skip to content

Commit

Permalink
Fix problems found during ESPIn 2024 (#145)
Browse files Browse the repository at this point in the history
* Skip tests on new OOP notebook

* Remove references to old notebooks

* Apply updated formatting rules

* black-jupyter overrode changes from nbqa-flake8

* Update link to Blanca documentation

* Fix typo

* Add a recommendation on function length

* Include bmi-geotiff as a dependency

* Add missing potluck dinner image

* Add missing West Bijou Creek visualizations

* Add recommendation to use a model configuration file

* Add recommendation on upstream remote
  • Loading branch information
mdpiper committed Aug 11, 2024
1 parent c5b9df9 commit 7b67140
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
1 change: 1 addition & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ channels:
- conda-forge
dependencies:
- python >=3.10
- bmi-geotiff
- bmi-topography
- bmipy
- imageio
Expand Down
6 changes: 6 additions & 0 deletions lessons/best-practices/collaboration-etiquette.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,15 @@ for working on a collaborative project.

## General

1. Don't hardcode model configuration values; use a configuration file in a plain text format like cfg, yaml, or toml, and read in the values.

1. You don't need an upstream remote when you own a repository. If your team or organization owns a repository, an upstream remote may not be necessary (depending on org rules or practices), but it may still be a good idea.

1. Avoid including data (input or output) in a source code repository. There's some gray area for data
used in an example, but the data should be small.

1. If a function takes up more than one screen, it may be too long. Consider factoring it into smaller programs.

1. Build scientific visualizations programmatically, ideally using an open source language or, secondarily, a scriptable open source visualization tool.

1. Don't alter a visualization manually (e.g., using commercial software such as Adobe Illustrator) after creating it. This breaks reproducibility.
Expand Down
2 changes: 1 addition & 1 deletion lessons/hpc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In this lesson we'll learn how to submit and run jobs on a cluster computer.
Cluster computing is explored in the following linked documents.

1. [Overview of cluster computing](./cluster-computing-overview.md)
1. [Blanca](https://curc.readthedocs.io/en/latest/access/blanca.html)
1. [Blanca](https://curc.readthedocs.io/en/latest/clusters/blanca/blanca.html)
1. [Getting a login on Blanca](https://csdms.colorado.edu/wiki/HPC)
1. [Logging in to Blanca](https://curc.readthedocs.io/en/latest/access/rmacc.html#logging-in-to-open-ondemand)
1. [Modules](https://curc.readthedocs.io/en/latest/compute/modules.html)
Expand Down
2 changes: 1 addition & 1 deletion lessons/landlab/landlab/02-data.a.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The values of the field nammed, \"foo\","
"The values of the field named, \"foo\","
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion lessons/landlab/landlab/02-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The values of the field nammed, \"foo\","
"The values of the field named, \"foo\","
]
},
{
Expand Down
16 changes: 6 additions & 10 deletions lessons/landlab/landlab/05-components.a.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
"source": [
"## Introduction to Landlab Components\n",
"\n",
"A \"potluck supper\" is a common American tradition in which each guest brights a dish to share. These contributed dishes usually come in one of a few categories: salads, drinks, main dishes, desserts. The meal comes together as a collection of components, each of which contributes to fulfilling one of these basic roles. The resulting meal provides guests with a great variety of choices. A guest can compose their own complete and unique meal by combining their own choices for components. And each guest, while contributing their own particular dish, get to share in the creations of their compatriots. There's a bit of standardization---the dishes are sized to fit on the tables, and their contents are accessible to the usual range of serving utensils---but with that standardization lies a great range of creativity.\n",
"A \"potluck\" is a meal in which each guest brings a dish to share. These contributed dishes usually come in one of a few categories: salads, drinks, main dishes, desserts. The meal comes together as a collection of components, each of which contributes to fulfilling one of these basic roles. The resulting meal provides guests with a great variety of choices. A guest can compose their own complete and unique meal by combining their own choices for components. And each guest, while contributing their own particular dish, get to share in the creations of their compatriots. There's a bit of standardization---the dishes are sized to fit on the tables, and their contents are accessible to the usual range of serving utensils---but with that standardization lies a great range of creativity.\n",
"\n",
"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",
"<img src=\"./media/potluck.jpeg\"\n",
" width = \"600\"\n",
" height = auto />\n",
"*Figure 1: A potluck meal (wikimedia commons).*\n"
"<img src=\"./media/Eat_Alberta_Potluck.jpg\">\n",
"*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*\n"
]
},
{
Expand All @@ -33,17 +31,15 @@
"\n",
"Here's an example from the Landlab tutorial *Green-Ampt infiltration and kinematic wave overland flow*. The example code in the tutorial uses two components, `SoilInfiltrationGreenAmpt` and `KinwaveImplicitOverlandFlow`, to calculate overland flow and infiltration across a terrain that is represented by a digital elevation model.\n",
"\n",
"![bijou_gully_topography.png](attachment:bijou_gully_topography.png)\n",
"*Figure 2: topography of a gullied area on the Colorado high plains (from Landlab tutorial \"Green-Ampt infiltration and kinematic wave overland flow\").*\n",
"\n"
"<img src=\"./media/bijou_gully_topography.png\">\n",
"*Figure 2: topography of a gullied area on the Colorado high plains (from Landlab tutorial \"Green-Ampt infiltration and kinematic wave overland flow\").*"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"![bijou_gully_infiltration.png](attachment:bijou_gully_infiltration.png)\n",
"\n",
"<img src=\"./media/bijou_gully_infiltration.png\">\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",
Expand Down
13 changes: 5 additions & 8 deletions lessons/landlab/landlab/05-components.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
"source": [
"## Introduction to Landlab Components\n",
"\n",
"A \"potluck supper\" is a common American tradition in which each guest brights a dish to share. These contributed dishes usually come in one of a few categories: salads, drinks, main dishes, desserts. The meal comes together as a collection of components, each of which contributes to fulfilling one of these basic roles. The resulting meal provides guests with a great variety of choices. A guest can compose their own complete and unique meal by combining their own choices for components. And each guest, while contributing their own particular dish, get to share in the creations of their compatriots. There's a bit of standardization---the dishes are sized to fit on the tables, and their contents are accessible to the usual range of serving utensils---but with that standardization lies a great range of creativity.\n",
"A \"potluck\" is a meal in which each guest brings a dish to share. These contributed dishes usually come in one of a few categories: salads, drinks, main dishes, desserts. The meal comes together as a collection of components, each of which contributes to fulfilling one of these basic roles. The resulting meal provides guests with a great variety of choices. A guest can compose their own complete and unique meal by combining their own choices for components. And each guest, while contributing their own particular dish, get to share in the creations of their compatriots. There's a bit of standardization---the dishes are sized to fit on the tables, and their contents are accessible to the usual range of serving utensils---but with that standardization lies a great range of creativity.\n",
"\n",
"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",
"<img src=\"./media/potluck.jpeg\"\n",
" width = \"600\"\n",
" height = auto />\n",
"*Figure 1: A potluck meal (wikimedia commons).*\n"
"<img src=\"./media/Eat_Alberta_Potluck.jpg\">\n",
"*Figure 1: A potluck meal (\"Eat Alberta Potluck\" from Wikimedia Commons).*\n"
]
},
{
Expand All @@ -33,7 +31,7 @@
"\n",
"Here's an example from the Landlab tutorial *Green-Ampt infiltration and kinematic wave overland flow*. The example code in the tutorial uses two components, `SoilInfiltrationGreenAmpt` and `KinwaveImplicitOverlandFlow`, to calculate overland flow and infiltration across a terrain that is represented by a digital elevation model.\n",
"\n",
"![bijou_gully_topography.png](attachment:bijou_gully_topography.png)\n",
"<img src=\"./media/bijou_gully_topography.png\">\n",
"*Figure 2: topography of a gullied area on the Colorado high plains (from Landlab tutorial \"Green-Ampt infiltration and kinematic wave overland flow\").*\n",
"\n"
]
Expand All @@ -42,8 +40,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"![bijou_gully_infiltration.png](attachment:bijou_gully_infiltration.png)\n",
"\n",
"<img src=\"./media/bijou_gully_infiltration.png\">\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",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7b67140

Please sign in to comment.