Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add oop 2 toc #30

Merged
merged 7 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Comment on lines +11 to +13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI - seems like the basic markdown syntax also works for the download!

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
Loading