Skip to content

Commit 5485192

Browse files
committed
Updated foundations notebook
1 parent f5d932f commit 5485192

File tree

1 file changed

+17
-106
lines changed

1 file changed

+17
-106
lines changed

notebooks/osdf_foundations.ipynb

Lines changed: 17 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -140,41 +140,20 @@
140140
"cell_type": "markdown",
141141
"metadata": {},
142142
"source": [
143-
"## Use OSDF ans PelicanFS protocol to access data"
143+
"## Use OSDF and PelicanFS protocol to access data"
144144
]
145145
},
146146
{
147147
"cell_type": "markdown",
148148
"metadata": {},
149149
"source": [
150-
"### Set up osdf url to use with PelicanFS\n",
150+
"### Set up osdf url to use with PelicanFS - Move this to next notebook ?????\n",
151151
"- We should one of the two pelicanFS FSSpec protocols ('osdf' or 'pelican') instead of the https protocol.\n",
152152
"- We will use the 'osdf' protocol and modify the existing CESM2-LENS catalog\n",
153153
"- So, the urls will look like: osdf_discovery_url/namespace_prefix/aws-region/bucket_name/path to file or object\n",
154154
"- In this case, the urls will look like osdf:///aws-opendata/us-west-2/ncar-cesm2-lens + path to individual zarr stores"
155155
]
156156
},
157-
{
158-
"cell_type": "markdown",
159-
"metadata": {},
160-
"source": [
161-
"#### Accessing data from a cache"
162-
]
163-
},
164-
{
165-
"cell_type": "markdown",
166-
"metadata": {},
167-
"source": [
168-
"#### Specifying a cache"
169-
]
170-
},
171-
{
172-
"cell_type": "markdown",
173-
"metadata": {},
174-
"source": [
175-
"#### Accessing data directly from an origin"
176-
]
177-
},
178157
{
179158
"cell_type": "code",
180159
"execution_count": null,
@@ -186,123 +165,55 @@
186165
"cell_type": "markdown",
187166
"metadata": {},
188167
"source": [
189-
"------------------------------------- Ignore below this line ------------------------------"
190-
]
191-
},
192-
{
193-
"cell_type": "markdown",
194-
"metadata": {},
195-
"source": [
196-
"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",
197-
"\n",
198-
"\\begin{align}\n",
199-
"\\dot{x} & = \\sigma(y-x) \\\\\n",
200-
"\\dot{y} & = \\rho x - y - xz \\\\\n",
201-
"\\dot{z} & = -\\beta z + xy\n",
202-
"\\end{align}"
203-
]
204-
},
205-
{
206-
"cell_type": "markdown",
207-
"metadata": {},
208-
"source": [
209-
"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*."
210-
]
211-
},
212-
{
213-
"cell_type": "markdown",
214-
"metadata": {},
215-
"source": [
216-
"## Last Section\n",
217-
"\n",
218-
"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):"
219-
]
220-
},
221-
{
222-
"cell_type": "markdown",
223-
"metadata": {},
224-
"source": [
225-
"<div class=\"admonition alert alert-info\">\n",
226-
" <p class=\"admonition-title\" style=\"font-weight:bold\">Info</p>\n",
227-
" Your relevant information here!\n",
228-
"</div>"
229-
]
230-
},
231-
{
232-
"cell_type": "markdown",
233-
"metadata": {},
234-
"source": [
235-
"Feel free to copy this around and edit or play around with yourself. Some other `admonitions` you can put in:"
236-
]
237-
},
238-
{
239-
"cell_type": "markdown",
240-
"metadata": {},
241-
"source": [
242-
"<div class=\"admonition alert alert-success\">\n",
243-
" <p class=\"admonition-title\" style=\"font-weight:bold\">Success</p>\n",
244-
" We got this done after all!\n",
245-
"</div>"
246-
]
247-
},
248-
{
249-
"cell_type": "markdown",
250-
"metadata": {},
251-
"source": [
252-
"<div class=\"admonition alert alert-warning\">\n",
253-
" <p class=\"admonition-title\" style=\"font-weight:bold\">Warning</p>\n",
254-
" Be careful!\n",
255-
"</div>"
168+
"#### Specifying a cache"
256169
]
257170
},
258171
{
259172
"cell_type": "markdown",
260173
"metadata": {},
261174
"source": [
262-
"<div class=\"admonition alert alert-danger\">\n",
263-
" <p class=\"admonition-title\" style=\"font-weight:bold\">Danger</p>\n",
264-
" Scary stuff be here.\n",
265-
"</div>"
175+
"pelfs = PelicanFileSystem(\"pelican://osg-htc.org\", preferred_caches=[\"https://cache.example.com\"])"
266176
]
267177
},
268178
{
269179
"cell_type": "markdown",
270180
"metadata": {},
271181
"source": [
272-
"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!"
182+
"#### Accessing data directly from an origin"
273183
]
274184
},
275185
{
276186
"cell_type": "markdown",
277187
"metadata": {},
278188
"source": [
279-
"---"
189+
"pelfs = PelicanFileSystem(\"pelican://osg-htc.org\", direct_reads=True)"
280190
]
281191
},
282192
{
283193
"cell_type": "markdown",
284194
"metadata": {},
285195
"source": [
286196
"## Summary\n",
287-
"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",
197+
"In this notebook, we gave a brief introduction to the Open Science Data Federation, the Pelican Platform and learnt how to access data using PelicanFS. In particular, we discussed how to use PelicanFS to\n",
198+
"\n",
199+
"- Access data without specifying a cache\n",
200+
"- Access data from a specific cache\n",
201+
"- Access data directly from the data origin\n",
202+
"\n",
203+
"all via the OSDF protocol.\n",
288204
"\n",
289205
"### What's next?\n",
290-
"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!"
206+
"In the next notebooks, we will learn how to access data from various climate datasets into our notebook using PelicanFS."
291207
]
292208
},
293209
{
294210
"cell_type": "markdown",
295211
"metadata": {},
296212
"source": [
297213
"## Resources and references\n",
298-
"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",
299-
" - `Kernel > Restart Kernel and Run All Cells...` to confirm that your notebook will cleanly run from start to finish\n",
300-
" - `Kernel > Restart Kernel and Clear All Outputs...` before committing your notebook, our machines will do the heavy lifting\n",
301-
" - Take credit! Provide author contact information if you'd like; if so, consider adding information here at the bottom of your notebook\n",
302-
" - Give credit! Attribute appropriate authorship for referenced code, information, images, etc.\n",
303-
" - Only include what you're legally allowed: **no copyright infringement or plagiarism**\n",
304-
" \n",
305-
"Thank you for your contribution!"
214+
"- [Open Science Data Federation](https://osg-htc.org/services/osdf.html)\n",
215+
"- [Pelican Platform](https://pelicanplatform.org)\n",
216+
"- [PelicanFS](https://github.com/PelicanPlatform/pelicanfs) "
306217
]
307218
}
308219
],

0 commit comments

Comments
 (0)