Skip to content

Commit

Permalink
2.5.0 Notebook Update (#665)
Browse files Browse the repository at this point in the history
* Add tree Binder dependency

* Notebooks update for uwtools 2.5.0
  • Loading branch information
Byrnetp authored Dec 3, 2024
1 parent 9760a95 commit 220c87b
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 25 deletions.
1 change: 1 addition & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ channels:
- conda-forge
- ufs-community
dependencies:
- tree
- uwtools
9 changes: 5 additions & 4 deletions notebooks/config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"\n",
"The `uwtools` API's `config` module provides functions to create and manipulate configuration files, objects, and dictionaries.\n",
"\n",
"Tested on `uwtools` version 2.4.2. For more information, please see the <a href=\"https://uwtools.readthedocs.io/en/2.4.2/sections/user_guide/api/config.html\">uwtools.api.config</a> Read the Docs page.\n",
"<div class=\"alert alert-warning\"><b>Note: </b>This notebook was tested using <code>uwtools</code> version 2.5.0.</div>\n",
"<div class=\"alert alert-info\">For more information, please see the <a href=\"https://uwtools.readthedocs.io/en/2.5.0/sections/user_guide/api/config.html\">uwtools.api.config</a> Read the Docs page.</div>\n",
"\n",
"## Table of Contents\n",
"\n",
Expand Down Expand Up @@ -1884,9 +1885,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python [conda env:DEV-uwtools] *",
"language": "python",
"name": "python3"
"name": "conda-env-DEV-uwtools-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1898,7 +1899,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions notebooks/exp-config-cb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Building and Validating an Experiment Configuration\n",
"\n",
"<div class=\"alert alert-warning\"><b>Note: </b>This notebook was tested using <code>uwtools</code> version 2.4.2.</div>\n",
"<div class=\"alert alert-warning\"><b>Note: </b>This notebook was tested using <code>uwtools</code> version 2.5.0.</div>\n",
"\n",
"This notebook demonstrates how to build up a configuration file for generating FV3 initial conditions (ICs) from a hierarchy of smaller, purpose-specific files; dereferencing Jinja2 expressions in the configuration; and validating the final configuration to check for potential errors. A larger, more complex experimental setup could be built up by applying similar techniques.\n",
"<!--cell 0-->"
Expand Down Expand Up @@ -381,9 +381,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python [conda env:DEV-uwtools] *",
"language": "python",
"name": "python3"
"name": "conda-env-DEV-uwtools-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -395,7 +395,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
9 changes: 5 additions & 4 deletions notebooks/fs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"\n",
"The `uwtools` API's `fs` module provides functions to copy and link files as well as create directories. \n",
"\n",
"For more information, please see the <a href=\"https://uwtools.readthedocs.io/en/main/sections/user_guide/api/fs.html\">uwtools.api.fs</a> Read the Docs page.\n",
"<div class=\"alert alert-warning\"><b>Note: </b>This notebook was tested using <code>uwtools</code> version 2.5.0. </div>\n",
"<div class=\"alert alert-info\">For more information, please see the <a href=\"https://uwtools.readthedocs.io/en/2.5.0/sections/user_guide/api/fs.html\">uwtools.api.fs</a> Read the Docs page.</div>\n",
"\n",
"## Table of Contents\n",
"\n",
Expand Down Expand Up @@ -1564,9 +1565,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python [conda env:DEV-uwtools] *",
"language": "python",
"name": "python3"
"name": "conda-env-DEV-uwtools-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1578,7 +1579,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
9 changes: 5 additions & 4 deletions notebooks/rocoto.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"\n",
"The `uwtools` API's `rocoto` module provides functions to build and validate Rocoto workflows. For more information on the UW YAML language than what is discussed here, see the <a href=\"https://uwtools.readthedocs.io/en/main/sections/user_guide/yaml/rocoto.html\">Defining a Rocoto Workflow</a> page. For more on Rocoto XML documents, see the <a href=\"https://christopherwharrop.github.io/rocoto/\">Rocoto Documentation</a>.\n",
"\n",
"Tested on `uwtools` version 2.4.2. For more information, please see the <a href=\"https://uwtools.readthedocs.io/en/2.4.2/sections/user_guide/api/rocoto.html\">uwtools.api.rocoto</a> Read the Docs page.\n",
"<div class=\"alert alert-warning\"><b>Note: </b>This notebook was tested using <code>uwtools</code> version 2.5.0. </div>\n",
"<div class=\"alert alert-info\">For more information, please see the <a href=\"https://uwtools.readthedocs.io/en/2.5.0/sections/user_guide/api/rocoto.html\">uwtools.api.rocoto</a> Read the Docs page.</div>\n",
"\n",
"## Table of Contents\n",
"* [Building Rocoto Workflows with UW YAML](#Building-Rocoto-Workflows-with-UW-YAML)\n",
Expand Down Expand Up @@ -1038,9 +1039,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python [conda env:DEV-uwtools] *",
"language": "python",
"name": "python3"
"name": "conda-env-DEV-uwtools-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1052,7 +1053,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
25 changes: 16 additions & 9 deletions notebooks/template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
"\n",
"The `uwtools` API's `template` module provides functions to render Jinja2 templates and to translate atparse templates to Jinja2.\n",
"\n",
"Tested on `uwtools` version 2.4.2. For more information, please see the <a href=\"https://uwtools.readthedocs.io/en/2.4.2/sections/user_guide/api/template.html\">uwtools.api.template</a> Read the Docs page."
"<div class=\"alert alert-warning\"><b>Note: </b>This notebook was tested using <code>uwtools</code> version 2.5.0. </div>\n",
"<div class=\"alert alert-info\">For more information, please see the <a href=\"https://uwtools.readthedocs.io/en/2.5.0/sections/user_guide/api/template.html\">uwtools.api.template</a> Read the Docs page.</div>\n",
"\n",
"## Table of Contents\n",
"\n",
"* [Rendering Values](#Rendering-Values)\n",
"* [Rendering to a String](#Rendering-to-a-String)\n",
"* [Translating atparse to Jinja2](#Translating-atparse-to-Jinja2)"
]
},
{
Expand All @@ -28,7 +35,7 @@
"id": "017c777a-1ca0-4fef-873f-89924e209da8",
"metadata": {},
"source": [
"## render\n",
"## Rendering Values\n",
"\n",
"`template.render()` renders a Jinja2 template using values provided by the specified values source."
]
Expand Down Expand Up @@ -290,7 +297,7 @@
"id": "58cbbfbf-b47d-485d-9ef3-80b067316d11",
"metadata": {},
"source": [
"## render_to_str\n",
"## Rendering to a String\n",
"\n",
"`template.render_to_str()` is identical to `template.render()` except that it does not accept an `output_file` parameter: It returns the rendered template as a string and does not write to a file or to `stdout`."
]
Expand Down Expand Up @@ -357,11 +364,11 @@
"id": "fe45be03-c1aa-4c50-a21b-3f35180569b4",
"metadata": {},
"source": [
"For more examples, please refer to the <a href='#render'>render</a> section above.\n",
"For more examples, please refer to the <a href='#Rendering-Values'>Rendering Values</a> section above.\n",
"\n",
"## translate\n",
"## Translating atparse to Jinja2\n",
"\n",
"This function can be used to translate atparse templates into Jinja2 templates by replacing `@[]` tokens with their corresponding `{{}}` Jinja2 equivalents. "
"The `translate()` function can be used to translate atparse templates into Jinja2 templates by replacing `@[]` tokens with their corresponding `{{}}` Jinja2 equivalents. "
]
},
{
Expand Down Expand Up @@ -489,9 +496,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python [conda env:DEV-uwtools] *",
"language": "python",
"name": "python3"
"name": "conda-env-DEV-uwtools-py"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -503,7 +510,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.7"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 220c87b

Please sign in to comment.