Skip to content

Commit

Permalink
Make sections in crash course notebook (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jthielen authored Jun 13, 2024
1 parent 259fc25 commit f1170be
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 87 deletions.
5 changes: 0 additions & 5 deletions notebooks/constants.py

This file was deleted.

122 changes: 40 additions & 82 deletions notebooks/intro/crash_course.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -79,48 +79,36 @@
"metadata": {},
"source": [
"## Imports\n",
"Begin your body of content with another `---` divider before continuing into this section, then remove this body text and populate the following code cell with all necessary Python imports **up-front**:"
"\n",
"Here we'll be using a basic set of Python libraries, along with Numba for fast numerical routines. A helpful constants file is also imported."
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import sys"
"import numpy as np\n",
"import numba\n",
"import xarray as xr\n",
"import matplotlib.pyplot as plt\n",
"\n",
"from constants import *"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Your first content section"
"## Introduction"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This is where you begin your first section of material, loosely tied to your objectives stated up front. Tie together your notebook as a narrative, with interspersed Markdown text, images, and more as necessary,"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# as well as any and all of your code cells\n",
"print(\"Hello world!\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### A content subsection\n",
"Divide and conquer your objectives with Markdown subsections, which will populate the helpful navbar in Jupyter Lab and here on the Jupyter Book!"
"...TODO..."
]
},
{
Expand All @@ -137,113 +125,80 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Another content subsection\n",
"Keep up the good work! A note, *try to avoid using code comments as narrative*, and instead let them only exist as brief clarifications where necessary."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Your second content section\n",
"Here we can move on to our second objective, and we can demonstrate"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Subsection to the second section\n",
"## Basic Equations\n",
"\n",
"#### a quick demonstration\n",
"\n",
"##### of further and further\n",
"\n",
"###### header levels"
"...TODO..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"as well $m = a * t / h$ text! Similarly, you have access to other $\\LaTeX$ equation [**functionality**](https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Typesetting%20Equations.html) via MathJax (demo below from link),\n",
"### Starting Equations\n",
"\n",
"\\begin{align}\n",
"\\dot{x} & = \\sigma(y-x) \\\\\n",
"\\dot{y} & = \\rho x - y - xz \\\\\n",
"\\dot{z} & = -\\beta z + xy\n",
"\\end{align}"
"...TODO..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Check out [**any number of helpful Markdown resources**](https://www.markdownguide.org/basic-syntax/) for further customizing your notebooks and the [**Jupyter docs**](https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Working%20With%20Markdown%20Cells.html) for Jupyter-specific formatting information. Don't hesitate to ask questions if you have problems getting it to look *just right*."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Last Section\n",
"### Assumptions and Simplification\n",
"\n",
"If you're comfortable, and as we briefly used for our embedded logo up top, you can embed raw html into Jupyter Markdown cells (edit to see):"
"...TODO..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-info\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Info</p>\n",
" Your relevant information here!\n",
"</div>"
"### Final Prognostic Equations\n",
"\n",
"...TODO..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Feel free to copy this around and edit or play around with yourself. Some other `admonitions` you can put in:"
"## Model Configuration\n",
"\n",
"...TODO..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-success\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Success</p>\n",
" We got this done after all!\n",
"</div>"
"### Grid Type\n",
"\n",
"...TODO..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-warning\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Warning</p>\n",
" Be careful!\n",
"</div>"
"### Initial/Boundary Conditions\n",
"\n",
"...TODO..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"admonition alert alert-danger\">\n",
" <p class=\"admonition-title\" style=\"font-weight:bold\">Danger</p>\n",
" Scary stuff be here.\n",
"</div>"
"## Discritization\n",
"\n",
"...TODO..."
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"source": [
"We also suggest checking out Jupyter Book's [brief demonstration](https://jupyterbook.org/content/metadata.html#jupyter-cell-tags) on adding cell tags to your cells in Jupyter Notebook, Lab, or manually. Using these cell tags can allow you to [customize](https://jupyterbook.org/interactive/hiding.html) how your code content is displayed and even [demonstrate errors](https://jupyterbook.org/content/execute.html#dealing-with-code-that-raises-errors) without altogether crashing our loyal army of machines!"
]
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
Expand All @@ -257,6 +212,9 @@
"metadata": {},
"source": [
"## Summary\n",
"\n",
"...TODO...\n",
"\n",
"Add one final `---` marking the end of your body of content, and then conclude with a brief single paragraph summarizing at a high level the key pieces that were learned and how they tied to your objectives. Look to reiterate what the most important takeaways were.\n",
"\n",
"### What's next?\n",
Expand Down Expand Up @@ -295,7 +253,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.11.6"
},
"nbdime-conflicts": {
"local_diff": [
Expand Down

0 comments on commit f1170be

Please sign in to comment.