Skip to content

Commit

Permalink
Merge pull request #30 from ICESAT-2HackWeek/add_OOP_2TOC
Browse files Browse the repository at this point in the history
Add oop 2 toc
  • Loading branch information
RomiP authored Aug 20, 2024
2 parents 8867ae2 + c3fee25 commit 2d60bca
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions book/tutorials/nb-to-package/OOP_intro.md
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions book/tutorials/nb-to-package/climate_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Very Simpl Climate Model
##########################

import numpy as np
import matplotlib.pyplot as plt
from co2_emissions import Constant_CO2, SSPEmissions
Expand Down

0 comments on commit 2d60bca

Please sign in to comment.