Skip to content

Commit

Permalink
UW-666 Jupyter Notebook: File System Tool (#598)
Browse files Browse the repository at this point in the history
* update_values() -> update_from() (#578)

* DRY out Driver._validate() (#579)

* Move execute() to its own API namespace, disambiguate (#580)

* Config classes to API (#582)

* Simplify unknown-extension error message (#584)

* UW-657 fs makedirs (#572)

* Docstring cleanup (#585)

* GH 586 bad stdin_ok prompt (#587)

* Fix issue with creating a metatask dep. (#589)

The rocoto schema is set up to allow metataskdep entries in the YAML, but the logic was not included in the tool to handle them. This addition fixes that.

* Add --show-schema support to drivers (#588)

* add file system notebook, unit tests, binder links

* Add missing newlines

* Add a table of contents

* Makefile and .gitignore changes from review

* Apply suggestions from code review

Co-authored-by: Paul Madden <[email protected]>

* Apply review suggestions to all sections of the notebook

* Specific rmtree() targeting and output cell test update

* Apply suggestions from code review

Co-authored-by: Paul Madden <[email protected]>

---------

Co-authored-by: Paul Madden <[email protected]>
Co-authored-by: Christina Holt <[email protected]>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent a842fa3 commit c6d6040
Show file tree
Hide file tree
Showing 15 changed files with 1,731 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
*.egg-info
*.swp
.coverage
__pycache__
.ipynb_checkpoints
__pycache__
3 changes: 3 additions & 0 deletions docs/sections/user_guide/api/fs.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
``uwtools.api.fs``
==================

.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/ufs-community/uwtools/notebooks?labpath=notebooks%2Ffs.ipynb

.. automodule:: uwtools.api.fs
:members:
1 change: 1 addition & 0 deletions docs/sections/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ User Guide
<li>API Jupyter Notebooks
<ul>
<li><a href="https://mybinder.org/v2/gh/ufs-community/uwtools/notebooks?labpath=notebooks%2Ftemplate.ipynb">Template Tool</a>
<li><a href="https://mybinder.org/v2/gh/ufs-community/uwtools/notebooks?labpath=notebooks%2Ffs.ipynb">File System Tool</a>
</ul>
</ul>

Expand Down
2 changes: 2 additions & 0 deletions notebooks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.ipynb_checkpoints
tmp
3 changes: 3 additions & 0 deletions notebooks/fixtures/fs/copy-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file1-copy.nml: fixtures/fs/file1.nml
data/file2-copy.txt: fixtures/fs/file2.txt
data/file3-copy.csv: fixtures/fs/file3.csv
6 changes: 6 additions & 0 deletions notebooks/fixtures/fs/copy-keys-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
files:
to:
copy:
file1-copy.nml: fixtures/fs/file1.nml
data/file2-copy.txt: fixtures/fs/file2.txt
data/file3-copy.csv: fixtures/fs/file3.csv
3 changes: 3 additions & 0 deletions notebooks/fixtures/fs/dir-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
makedirs:
- foo
- bar/baz
6 changes: 6 additions & 0 deletions notebooks/fixtures/fs/dir-keys-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
path:
to:
dirs:
makedirs:
- foo/bar
- baz
6 changes: 6 additions & 0 deletions notebooks/fixtures/fs/file1.nml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
&animal
name = 'zebra'
num_legs = 4
diet_type = 'herbivore'
location = 'Africa'
/
1 change: 1 addition & 0 deletions notebooks/fixtures/fs/file2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fun Fact: A group of zebras is called a "zeal" or a "dazzle".
4 changes: 4 additions & 0 deletions notebooks/fixtures/fs/file3.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
id,location,age
B524,Botswana,12
N290,Namibia,4
K296,Kenya,23
3 changes: 3 additions & 0 deletions notebooks/fixtures/fs/link-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file1-link.nml: fixtures/fs/file1.nml
file2-link.txt: fixtures/fs/file2.txt
data/file3-link.csv: fixtures/fs/file3.csv
6 changes: 6 additions & 0 deletions notebooks/fixtures/fs/link-keys-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
files:
to:
link:
file1-link.nml: fixtures/fs/file1.nml
file2-link.txt: fixtures/fs/file2.txt
data/file3-link.csv: fixtures/fs/file3.csv
Loading

0 comments on commit c6d6040

Please sign in to comment.