Skip to content

Commit

Permalink
Merge pull request #1 from song-sangmin/main
Browse files Browse the repository at this point in the history
add two section notebooks
  • Loading branch information
song-sangmin authored Jun 11, 2024
2 parents 9df40f5 + 21edc8e commit 4614c35
Show file tree
Hide file tree
Showing 3 changed files with 359 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
This Project Pythia Cookbook covers two objectives:

1. Accessing publicly available, quality-controlled [Biogeochemical-Argo](https://biogeochemical-argo.org/) ocean observations
2. Demonstrating uses of [scikit-learn](https://scikit-learn.org/), a powerful and accessible Python package for machine learning.
2. Demonstrating uses of [scikit-learn](https://scikit-learn.org/), a powerful Python package for machine learning.


## Motivation
Expand Down
File renamed without changes.
358 changes: 358 additions & 0 deletions notebooks/sklearn-examples.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,358 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's start here! If you can directly link to an image relevant to your notebook, such as [canonical logos](https://github.com/numpy/numpy/blob/main/doc/source/_static/numpylogo.svg), do so here at the top of your notebook. You can do this with Markdown syntax,\n",
"\n",
"> `![<image title>](http://link.com/to/image.png \"image alt text\")`\n",
"\n",
"or edit this cell to see raw HTML `img` demonstration. This is preferred if you need to shrink your embedded image. **Either way be sure to include `alt` text for any embedded images to make your content more accessible.**\n",
"\n",
"<img src=\"images/ProjectPythia_Logo_Final-01-Blue.svg\" width=250 alt=\"Project Pythia Logo\"></img>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Project Pythia Notebook Template\n",
"\n",
"Next, title your notebook appropriately with a top-level Markdown header, `#`. Do not use this level header anywhere else in the notebook. Our book build process will use this title in the navbar, table of contents, etc. Keep it short, keep it descriptive. Follow this with a `---` cell to visually distinguish the transition to the prerequisites section."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Overview\n",
"If you have an introductory paragraph, lead with it here! Keep it short and tied to your material, then be sure to continue into the required list of topics below,\n",
"\n",
"1. This is a numbered list of the specific topics\n",
"1. These should map approximately to your main sections of content\n",
"1. Or each second-level, `##`, header in your notebook\n",
"1. Keep the size and scope of your notebook in check\n",
"1. And be sure to let the reader know up front the important concepts they'll be leaving with"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Prerequisites\n",
"This section was inspired by [this template](https://github.com/alan-turing-institute/the-turing-way/blob/master/book/templates/chapter-template/chapter-landing-page.md) of the wonderful [The Turing Way](https://the-turing-way.netlify.app) Jupyter Book.\n",
"\n",
"Following your overview, tell your reader what concepts, packages, or other background information they'll **need** before learning your material. Tie this explicitly with links to other pages here in Foundations or to relevant external resources. Remove this body text, then populate the Markdown table, denoted in this cell with `|` vertical brackets, below, and fill out the information following. In this table, lay out prerequisite concepts by explicitly linking to other Foundations material or external resources, or describe generally helpful concepts.\n",
"\n",
"Label the importance of each concept explicitly as **helpful/necessary**.\n",
"\n",
"| Concepts | Importance | Notes |\n",
"| --- | --- | --- |\n",
"| [Intro to Cartopy](https://foundations.projectpythia.org/core/cartopy/cartopy.html) | Necessary | |\n",
"| [Understanding of NetCDF](https://foundations.projectpythia.org/core/data-formats/netcdf-cf.html) | Helpful | Familiarity with metadata structure |\n",
"| Project management | Helpful | |\n",
"\n",
"- **Time to learn**: estimate in minutes. For a rough idea, use 5 mins per subsection, 10 if longer; add these up for a total. Safer to round up and overestimate.\n",
"- **System requirements**:\n",
" - Populate with any system, version, or non-Python software requirements if necessary\n",
" - Otherwise use the concepts table above and the Imports section below to describe required packages as necessary\n",
" - If no extra requirements, remove the **System requirements** point altogether"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"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**:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import sys"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Your first content section"
]
},
{
"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!"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# some subsection code\n",
"new = \"helpful information\""
]
},
{
"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",
"\n",
"#### a quick demonstration\n",
"\n",
"##### of further and further\n",
"\n",
"###### header levels"
]
},
{
"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",
"\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}"
]
},
{
"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",
"\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):"
]
},
{
"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>"
]
},
{
"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:"
]
},
{
"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>"
]
},
{
"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>"
]
},
{
"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>"
]
},
{
"cell_type": "markdown",
"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!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Summary\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",
"Let Jupyter book tie this to the next (sequential) piece of content that people could move on to down below and in the sidebar. However, if this page uniquely enables your reader to tackle other nonsequential concepts throughout this book, or even external content, link to it here!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Resources and references\n",
"Finally, be rigorous in your citations and references as necessary. Give credit where credit is due. Also, feel free to link to relevant external material, further reading, documentation, etc. Then you're done! Give yourself a quick review, a high five, and send us a pull request. A few final notes:\n",
" - `Kernel > Restart Kernel and Run All Cells...` to confirm that your notebook will cleanly run from start to finish\n",
" - `Kernel > Restart Kernel and Clear All Outputs...` before committing your notebook, our machines will do the heavy lifting\n",
" - Take credit! Provide author contact information if you'd like; if so, consider adding information here at the bottom of your notebook\n",
" - Give credit! Attribute appropriate authorship for referenced code, information, images, etc.\n",
" - Only include what you're legally allowed: **no copyright infringement or plagiarism**\n",
" \n",
"Thank you for your contribution!"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
},
"nbdime-conflicts": {
"local_diff": [
{
"diff": [
{
"diff": [
{
"key": 0,
"op": "addrange",
"valuelist": [
"Python 3"
]
},
{
"key": 0,
"length": 1,
"op": "removerange"
}
],
"key": "display_name",
"op": "patch"
}
],
"key": "kernelspec",
"op": "patch"
}
],
"remote_diff": [
{
"diff": [
{
"diff": [
{
"key": 0,
"op": "addrange",
"valuelist": [
"Python3"
]
},
{
"key": 0,
"length": 1,
"op": "removerange"
}
],
"key": "display_name",
"op": "patch"
}
],
"key": "kernelspec",
"op": "patch"
}
]
},
"toc-autonumbering": false
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit 4614c35

Please sign in to comment.