diff --git a/book/_toc.yml b/book/_toc.yml index 6f7333b..2125e28 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -24,6 +24,7 @@ parts: - file: tutorials/cryocloud_demo/CryoCloud_demo.ipynb - file: tutorials/nb-to-package/index sections: + - file: tutorials/nb-to-package/OOP_intro - file: tutorials/nb-to-package/intro sections: - file: tutorials/nb-to-package/sample.ipynb diff --git a/book/tutorials/nb-to-package/OOP_intro.md b/book/tutorials/nb-to-package/OOP_intro.md new file mode 100644 index 0000000..23e02da --- /dev/null +++ b/book/tutorials/nb-to-package/OOP_intro.md @@ -0,0 +1,13 @@ +# Intro to Object Oriented Programming (OOP) + +In this tutorial, we'll be learning how to structure object-oriented code +to take full advantage of this programming paradigm. + +Follow along with the slides [`here`](./OOP.pdf)! + +We'll be using UCAR's ['Very Simple Climate Model'](https://scied.ucar.edu/interactive/simple-climate-model) as an example. + +Go ahead and preview the code we'll write together +- {download}`climate_model.py <./climate_model.py>` +- {download}`co2_emissions.py <./co2_emissions.py>` +- Some sample data: [`SSP_CO2emissions.csv`](./SSP_CO2emissions.csv) diff --git a/book/tutorials/nb-to-package/climate_model.py b/book/tutorials/nb-to-package/climate_model.py index f3e9b11..41c05bf 100644 --- a/book/tutorials/nb-to-package/climate_model.py +++ b/book/tutorials/nb-to-package/climate_model.py @@ -1,3 +1,6 @@ +# Very Simpl Climate Model +########################## + import numpy as np import matplotlib.pyplot as plt from co2_emissions import Constant_CO2, SSPEmissions