Skip to content

Commit

Permalink
Apply updated formatting (#144)
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
  • Loading branch information
mdpiper committed Aug 9, 2024
1 parent 4c31824 commit c5b9df9
Show file tree
Hide file tree
Showing 16 changed files with 107 additions and 244 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down Expand Up @@ -130,6 +132,7 @@
"# initialize the model by passing the correct arguments and\n",
"# keyword arguments.\n",
"\n",
"\n",
"model = BasicRt(\n",
" clock,\n",
" grid,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down Expand Up @@ -129,6 +131,7 @@
"# initialize the model by passing the correct arguments and\n",
"# keyword arguments.\n",
"\n",
"\n",
"model = BasicRt(\n",
" clock,\n",
" grid,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
"outputs": [],
"source": [
"# we can use an output writer to run until the model reaches steady state.\n",
"\n",
"\n",
"class run_to_steady:\n",
" def __init__(self, model):\n",
" self.model = model\n",
Expand Down
2 changes: 2 additions & 0 deletions lessons/landlab/landlab/bedrock_landslides_on_dems.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@
"outputs": [],
"source": [
"# These are plotting functions\n",
"\n",
"\n",
"def plotting(\n",
" grid, topo=True, DA=True, hill_DA=False, flow_metric=\"D8\", hill_flow_metric=\"Quinn\"\n",
"):\n",
Expand Down
1 change: 1 addition & 0 deletions lessons/landlab/landlab/create_a_component.a.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
"source": [
"# Type your code here: calculate time step\n",
"\n",
"\n",
"for _ in trange(1000):\n",
" ... # Type your code here: calculate diffusion and update *z*\n",
"\n",
Expand Down
1 change: 1 addition & 0 deletions lessons/landlab/landlab/create_a_component.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
"source": [
"# Type your code here: calculate time step\n",
"\n",
"\n",
"for _ in trange(1000):\n",
" ... # Type your code here: calculate diffusion and update *z*\n",
"\n",
Expand Down
8 changes: 8 additions & 0 deletions lessons/python/rainfall_runoff.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
"outputs": [],
"source": [
"# calculate time to peak\n",
"\n",
"\n",
"def calculate_time_to_peak(length, slope, t_rain):\n",
" \"\"\"\n",
" Calculate the time to peak of a hydrograph using the SCS-CN method.\n",
Expand Down Expand Up @@ -165,6 +167,8 @@
"outputs": [],
"source": [
"# calculate peak discharge\n",
"\n",
"\n",
"def calculate_peak_discharge(area, w_eff, t_peak):\n",
" \"\"\"\n",
" Calculate the peak discharge of a hydrograph using the SCS-CN method.\n",
Expand Down Expand Up @@ -245,6 +249,8 @@
"outputs": [],
"source": [
"# calculate the runoff hydrograph\n",
"\n",
"\n",
"def calculate_runoff_hydrograph(q_peak, t_peak, unit_hydrograph):\n",
" \"\"\"\n",
" Calculate the runoff hydrograph using the SCS-CN method.\n",
Expand Down Expand Up @@ -289,6 +295,8 @@
"outputs": [],
"source": [
"# create a model function\n",
"\n",
"\n",
"def scs_curve_number_model(cn, area, length, slope, t_rain, w, unit_hydrograph):\n",
" \"\"\"\n",
" Model the runoff hydrograph using the SCS-CN method.\n",
Expand Down
Loading

0 comments on commit c5b9df9

Please sign in to comment.