From 92690ef003ddddaf90f0d42128f7fe267106f695 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Fri, 1 Nov 2024 18:19:48 -0400 Subject: [PATCH 01/55] add prelim wflow def and script --- .github/scripts/doc_build.sh | 26 ++++++++++++++++++++++++++ .github/workflows/doc_tests.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/scripts/doc_build.sh create mode 100644 .github/workflows/doc_tests.yaml diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh new file mode 100644 index 0000000000..65d8854ef0 --- /dev/null +++ b/.github/scripts/doc_build.sh @@ -0,0 +1,26 @@ +# This script rebuilds technical documentation for the ush and tests/WE2E Python scripts +# The build will fail if there are warnings. +# Warnings may be cause by incomplete or nonexistent documentation +# as well as by minor issues such as broken external links that need to be fixed or removed + + +# Install prerequisites +apt-get install python3-sphinx +sphinx_rtd_theme +sphinxcontrib-bibtex + + +# Remove existing directories +cd doc/TechDocs +rm -rf ush +rm -rf tests + +# Regenerate docs in ush and tests/WE2E based on current state of scripts in those directories. +sphinx-apidoc -fM -o ./TechDocs/ush ../ush +sphinx-apidoc -fM -o ./TechDocs/tests/WE2E ../tests/WE2E + +# Need to check if there's a mismatch between what comes out of this build +# and what is in the PR. + +# May be able eventually to add an action that adds the properly built docs to the PR or the target branch + diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml new file mode 100644 index 0000000000..61195ac8a0 --- /dev/null +++ b/.github/workflows/doc_tests.yaml @@ -0,0 +1,25 @@ +name: Doc Tests +on: + push: + branches: + - develop + - 'release/*' + pull_request: + branches: + - develop + - 'release/*' + workflow_dispatch: + +defaults: + run: + shell: bash -leo pipefail {0} + +jobs: + doc_tests: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build documentation + run: .github/scripts/doc_build.sh From 6df170a062b42672ed1c13eef2bbfc86c4270432 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Fri, 1 Nov 2024 18:24:30 -0400 Subject: [PATCH 02/55] update workflow dispatch option --- .github/workflows/doc_tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index 61195ac8a0..d4cd965bb9 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -9,6 +9,8 @@ on: - develop - 'release/*' workflow_dispatch: + branches: + - 'feature/doc-actions' defaults: run: From 705142417a6a93cd6920450bedbe527132243f39 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Fri, 1 Nov 2024 18:25:39 -0400 Subject: [PATCH 03/55] update push option --- .github/workflows/doc_tests.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index d4cd965bb9..4d415f1684 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -1,9 +1,6 @@ name: Doc Tests on: push: - branches: - - develop - - 'release/*' pull_request: branches: - develop From d5d42124f7aa120b74468e6250d14da851cd74b4 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Fri, 1 Nov 2024 18:27:18 -0400 Subject: [PATCH 04/55] make doc_test.sh executable --- .github/scripts/doc_build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index 65d8854ef0..697d219e8a 100644 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -1,3 +1,4 @@ +#!/bin/bash # This script rebuilds technical documentation for the ush and tests/WE2E Python scripts # The build will fail if there are warnings. # Warnings may be cause by incomplete or nonexistent documentation From 6342b003196a552b9f8c08031a882c177d0dfd13 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:17:40 -0400 Subject: [PATCH 05/55] rm erroneous pipefail cmd --- .github/workflows/doc_tests.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index 4d415f1684..762496fe84 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -9,10 +9,6 @@ on: branches: - 'feature/doc-actions' -defaults: - run: - shell: bash -leo pipefail {0} - jobs: doc_tests: runs-on: ubuntu-latest From 8510b0388ff02549b1fe02e3a941a151acb37fde Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:22:40 -0400 Subject: [PATCH 06/55] make doc_build.sh executable --- .github/scripts/doc_build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .github/scripts/doc_build.sh diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh old mode 100644 new mode 100755 From a559dea73037eda605a39ab56cc87ecd62d7f41f Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:27:33 -0400 Subject: [PATCH 07/55] rm rtd theme & bibtex lines --- .github/scripts/doc_build.sh | 4 ++-- .github/workflows/doc_tests.yaml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index 697d219e8a..91dfc07876 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -7,8 +7,8 @@ # Install prerequisites apt-get install python3-sphinx -sphinx_rtd_theme -sphinxcontrib-bibtex +#sphinx_rtd_theme +#sphinxcontrib-bibtex # Remove existing directories diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index 762496fe84..6a1d42ef34 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -9,6 +9,10 @@ on: branches: - 'feature/doc-actions' +#defaults: +# run: +# shell: bash -leo pipefail {0} + jobs: doc_tests: runs-on: ubuntu-latest From 1f751b86bcec2a770e80291c4be2811146846e31 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:31:53 -0400 Subject: [PATCH 08/55] sudo install sphinx --- .github/scripts/doc_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index 91dfc07876..1328dde9a3 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -6,7 +6,7 @@ # Install prerequisites -apt-get install python3-sphinx +sudo apt-get install python3-sphinx #sphinx_rtd_theme #sphinxcontrib-bibtex From 5a69f6ac3b061045c7ac07d7e063433066268ee5 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:33:42 -0400 Subject: [PATCH 09/55] fix paths --- .github/scripts/doc_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index 1328dde9a3..469448e7b4 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -17,8 +17,8 @@ rm -rf ush rm -rf tests # Regenerate docs in ush and tests/WE2E based on current state of scripts in those directories. -sphinx-apidoc -fM -o ./TechDocs/ush ../ush -sphinx-apidoc -fM -o ./TechDocs/tests/WE2E ../tests/WE2E +sphinx-apidoc -fM -o TechDocs/ush ../ush +sphinx-apidoc -fM -o TechDocs/tests/WE2E ../tests/WE2E # Need to check if there's a mismatch between what comes out of this build # and what is in the PR. From f7ce17f1efbe94d64b94aad62b3877026039f2bf Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:41:04 -0400 Subject: [PATCH 10/55] fix dir path? --- .github/scripts/doc_build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index 469448e7b4..a532b13fdf 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -12,9 +12,10 @@ sudo apt-get install python3-sphinx # Remove existing directories -cd doc/TechDocs -rm -rf ush -rm -rf tests +echo pwd +cd ./doc/TechDocs +rm -rf ./ush +rm -rf ./tests # Regenerate docs in ush and tests/WE2E based on current state of scripts in those directories. sphinx-apidoc -fM -o TechDocs/ush ../ush From 04f1586c40083dbedf9a3fbb7ee50c12e496bc86 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:44:07 -0400 Subject: [PATCH 11/55] fix dir path? --- .github/scripts/doc_build.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index a532b13fdf..fe145a84f1 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -12,10 +12,11 @@ sudo apt-get install python3-sphinx # Remove existing directories -echo pwd -cd ./doc/TechDocs -rm -rf ./ush -rm -rf ./tests +echo `pwd` +cd doc/TechDocs +ls +rm -rf ush +rm -rf tests # Regenerate docs in ush and tests/WE2E based on current state of scripts in those directories. sphinx-apidoc -fM -o TechDocs/ush ../ush From 28457a6d474dd1f535a5425790a617f7e3361529 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:48:13 -0400 Subject: [PATCH 12/55] fix dir path? --- .github/scripts/doc_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index fe145a84f1..1f7d35655a 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -15,8 +15,8 @@ sudo apt-get install python3-sphinx echo `pwd` cd doc/TechDocs ls -rm -rf ush -rm -rf tests +rm -rf TechDocs/ush +rm -rf TechDocs/tests # Regenerate docs in ush and tests/WE2E based on current state of scripts in those directories. sphinx-apidoc -fM -o TechDocs/ush ../ush From 97b4e8922343372d8af4ab14e97b8bfcb02ef608 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:51:04 -0400 Subject: [PATCH 13/55] fix dir path? --- .github/scripts/doc_build.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index 1f7d35655a..4363c6896d 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -12,15 +12,13 @@ sudo apt-get install python3-sphinx # Remove existing directories -echo `pwd` cd doc/TechDocs -ls -rm -rf TechDocs/ush -rm -rf TechDocs/tests +rm -rf ush +rm -rf tests # Regenerate docs in ush and tests/WE2E based on current state of scripts in those directories. -sphinx-apidoc -fM -o TechDocs/ush ../ush -sphinx-apidoc -fM -o TechDocs/tests/WE2E ../tests/WE2E +sphinx-apidoc -fM -o ./TechDocs/ush ../../ush +sphinx-apidoc -fM -o ./TechDocs/tests/WE2E ../../tests/WE2E # Need to check if there's a mismatch between what comes out of this build # and what is in the PR. From 9f939cf2dbd96a9b0c772ebb4585d14722d6679c Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 22:59:22 -0400 Subject: [PATCH 14/55] delete calculate_cost.py for testing purposes --- doc/TechDocs/ush/calculate_cost.rst | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 doc/TechDocs/ush/calculate_cost.rst diff --git a/doc/TechDocs/ush/calculate_cost.rst b/doc/TechDocs/ush/calculate_cost.rst deleted file mode 100644 index aa85031292..0000000000 --- a/doc/TechDocs/ush/calculate_cost.rst +++ /dev/null @@ -1,7 +0,0 @@ -calculate\_cost module -====================== - -.. automodule:: calculate_cost - :members: - :undoc-members: - :show-inheritance: From fe7cf3fdb24abf02bac54565b0ff238987622995 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 23:14:58 -0400 Subject: [PATCH 15/55] add git diff --- .github/scripts/doc_build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index 4363c6896d..d71749120a 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -23,5 +23,7 @@ sphinx-apidoc -fM -o ./TechDocs/tests/WE2E ../../tests/WE2E # Need to check if there's a mismatch between what comes out of this build # and what is in the PR. +git diff + # May be able eventually to add an action that adds the properly built docs to the PR or the target branch From f72f2444330bf7101931fa7b113bfcc0ba29d39b Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 23:27:04 -0400 Subject: [PATCH 16/55] test what's in dirs --- .github/scripts/doc_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index d71749120a..1e733359c0 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -19,7 +19,7 @@ rm -rf tests # Regenerate docs in ush and tests/WE2E based on current state of scripts in those directories. sphinx-apidoc -fM -o ./TechDocs/ush ../../ush sphinx-apidoc -fM -o ./TechDocs/tests/WE2E ../../tests/WE2E - +ls # Need to check if there's a mismatch between what comes out of this build # and what is in the PR. From 02c14dcdf78dd38ff4d1f49285115e057e7854d3 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 23:40:34 -0400 Subject: [PATCH 17/55] update paths --- .github/scripts/doc_build.sh | 5 +++-- .github/workflows/doc_tests.yaml | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/doc_build.sh index 1e733359c0..025459d994 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/doc_build.sh @@ -15,10 +15,11 @@ sudo apt-get install python3-sphinx cd doc/TechDocs rm -rf ush rm -rf tests +echo $PWD # Regenerate docs in ush and tests/WE2E based on current state of scripts in those directories. -sphinx-apidoc -fM -o ./TechDocs/ush ../../ush -sphinx-apidoc -fM -o ./TechDocs/tests/WE2E ../../tests/WE2E +sphinx-apidoc -fM -o ./ush ../../ush +sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E ls # Need to check if there's a mismatch between what comes out of this build # and what is in the PR. diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index 6a1d42ef34..d733610fc5 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -19,6 +19,5 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Build documentation run: .github/scripts/doc_build.sh From 8f11d3d5e542c28a98303f66d244770c2edc1e00 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 23:48:10 -0400 Subject: [PATCH 18/55] update script name; add build step --- .../scripts/{doc_build.sh => update_tech_doc.sh} | 14 +++++--------- .github/workflows/doc_tests.yaml | 6 +++++- 2 files changed, 10 insertions(+), 10 deletions(-) rename .github/scripts/{doc_build.sh => update_tech_doc.sh} (64%) diff --git a/.github/scripts/doc_build.sh b/.github/scripts/update_tech_doc.sh similarity index 64% rename from .github/scripts/doc_build.sh rename to .github/scripts/update_tech_doc.sh index 025459d994..ff80abfaf6 100755 --- a/.github/scripts/doc_build.sh +++ b/.github/scripts/update_tech_doc.sh @@ -1,30 +1,26 @@ #!/bin/bash # This script rebuilds technical documentation for the ush and tests/WE2E Python scripts # The build will fail if there are warnings. -# Warnings may be cause by incomplete or nonexistent documentation +# Warnings may be caused by incomplete or nonexistent documentation # as well as by minor issues such as broken external links that need to be fixed or removed - # Install prerequisites sudo apt-get install python3-sphinx -#sphinx_rtd_theme -#sphinxcontrib-bibtex - # Remove existing directories cd doc/TechDocs rm -rf ush -rm -rf tests +rm -rf tests/WE2E echo $PWD -# Regenerate docs in ush and tests/WE2E based on current state of scripts in those directories. +# Regenerate tech docs in ush and tests/WE2E based on current state of scripts in those directories. sphinx-apidoc -fM -o ./ush ../../ush sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E ls -# Need to check if there's a mismatch between what comes out of this build -# and what is in the PR. +# Check for mismatch between what comes out of this action and what is in the PR. git diff + # May be able eventually to add an action that adds the properly built docs to the PR or the target branch diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index d733610fc5..ed92590ae9 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -19,5 +19,9 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Build documentation + - name: Update tech docs run: .github/scripts/doc_build.sh + - name: Build documentation + run: | + cd doc + make doc From b82dbb11aed42e0ecf52c2a7afb1e94675b8d19e Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 23:48:52 -0400 Subject: [PATCH 19/55] update file name: --- .github/workflows/doc_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index ed92590ae9..caaf875b6f 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -20,7 +20,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Update tech docs - run: .github/scripts/doc_build.sh + run: .github/scripts/update_tech_doc.sh - name: Build documentation run: | cd doc From c50ddc138c5be63634bb495a5ef616f6a5d55fe4 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sat, 2 Nov 2024 23:59:06 -0400 Subject: [PATCH 20/55] install sphinx rtd theme --- .github/scripts/update_tech_doc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/update_tech_doc.sh b/.github/scripts/update_tech_doc.sh index ff80abfaf6..7bf1c7af2e 100755 --- a/.github/scripts/update_tech_doc.sh +++ b/.github/scripts/update_tech_doc.sh @@ -6,6 +6,7 @@ # Install prerequisites sudo apt-get install python3-sphinx +sudo apt-get install python3-sphinx-rtd-theme # Remove existing directories cd doc/TechDocs From ca2c338e14b40881d4c73c57b0cd99a7349959d7 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 00:03:24 -0400 Subject: [PATCH 21/55] update requirements files --- doc/requirements.in | 1 - doc/requirements.txt | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/doc/requirements.in b/doc/requirements.in index 831cdc431d..26c778f4aa 100644 --- a/doc/requirements.in +++ b/doc/requirements.in @@ -1,4 +1,3 @@ sphinx>=6.0.0 sphinx_rtd_theme sphinxcontrib-bibtex -sphinxcontrib-autoyaml diff --git a/doc/requirements.txt b/doc/requirements.txt index 38fdd2ef01..966f96f598 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --strip-extras requirements.in +# pip-compile requirements.in # alabaster==0.7.16 # via sphinx @@ -42,8 +42,6 @@ pyyaml==6.0.1 # via pybtex requests==2.32.2 # via sphinx -ruamel-yaml==0.16.13 - # via sphinxcontrib-autoyaml six==1.16.0 # via # latexcodec @@ -54,15 +52,12 @@ sphinx==7.2.6 # via # -r requirements.in # sphinx-rtd-theme - # sphinxcontrib-autoyaml # sphinxcontrib-bibtex # sphinxcontrib-jquery sphinx-rtd-theme==2.0.0 # via -r requirements.in sphinxcontrib-applehelp==1.0.8 # via sphinx -sphinxcontrib-autoyaml==1.1.1 - # via -r requirements.in sphinxcontrib-bibtex==2.6.2 # via -r requirements.in sphinxcontrib-devhelp==1.0.6 From 3268c3702fb80755f7dfbd8ba76003e7adc0b399 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 00:05:22 -0400 Subject: [PATCH 22/55] rm autoyaml from conf.py --- doc/conf.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index f1f094d545..340b9948e1 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -46,7 +46,6 @@ extensions = [ 'sphinx_rtd_theme', 'sphinx.ext.autodoc', - 'sphinxcontrib.autoyaml', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.extlinks', @@ -310,10 +309,3 @@ def warn_undocumented_members(app, what, name, obj, options, lines): 'uw': ('https://uwtools.readthedocs.io/en/main/%s', '%s'), } -# -- Options for autoyaml extension --------------------------------------- - -autoyaml_root = "../ush" -autoyaml_doc_delimiter = "###" # Character(s) which start a documentation comment. -autoyaml_comment = "#" #Comment start character(s). -autoyaml_level = 6 -#autoyaml_safe_loader = False \ No newline at end of file From f81e9a75839fe3caeabb51e1a3c67ea655db79b3 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 00:20:56 -0400 Subject: [PATCH 23/55] rm set_fv3 files --- doc/TechDocs/ush/set_FV3nml_ens_stoch_seeds.rst | 7 ------- doc/TechDocs/ush/set_FV3nml_sfc_climo_filenames.rst | 7 ------- 2 files changed, 14 deletions(-) delete mode 100644 doc/TechDocs/ush/set_FV3nml_ens_stoch_seeds.rst delete mode 100644 doc/TechDocs/ush/set_FV3nml_sfc_climo_filenames.rst diff --git a/doc/TechDocs/ush/set_FV3nml_ens_stoch_seeds.rst b/doc/TechDocs/ush/set_FV3nml_ens_stoch_seeds.rst deleted file mode 100644 index 049c01d059..0000000000 --- a/doc/TechDocs/ush/set_FV3nml_ens_stoch_seeds.rst +++ /dev/null @@ -1,7 +0,0 @@ -set\_fv3nml\_ens\_stoch\_seeds module -===================================== - -.. automodule:: set_fv3nml_ens_stoch_seeds - :members: - :undoc-members: - :show-inheritance: diff --git a/doc/TechDocs/ush/set_FV3nml_sfc_climo_filenames.rst b/doc/TechDocs/ush/set_FV3nml_sfc_climo_filenames.rst deleted file mode 100644 index bc0a942e82..0000000000 --- a/doc/TechDocs/ush/set_FV3nml_sfc_climo_filenames.rst +++ /dev/null @@ -1,7 +0,0 @@ -set\_fv3nml\_sfc\_climo\_filenames module -========================================= - -.. automodule:: set_fv3nml_sfc_climo_filenames - :members: - :undoc-members: - :show-inheritance: From ba5e95e955d9f7376e1b428a6ec8e042c4911992 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 00:22:00 -0400 Subject: [PATCH 24/55] re-add set_fv3nml files --- doc/TechDocs/ush/set_fv3nml_ens_stoch_seeds.rst | 7 +++++++ doc/TechDocs/ush/set_fv3nml_sfc_climo_filenames.rst | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 doc/TechDocs/ush/set_fv3nml_ens_stoch_seeds.rst create mode 100644 doc/TechDocs/ush/set_fv3nml_sfc_climo_filenames.rst diff --git a/doc/TechDocs/ush/set_fv3nml_ens_stoch_seeds.rst b/doc/TechDocs/ush/set_fv3nml_ens_stoch_seeds.rst new file mode 100644 index 0000000000..049c01d059 --- /dev/null +++ b/doc/TechDocs/ush/set_fv3nml_ens_stoch_seeds.rst @@ -0,0 +1,7 @@ +set\_fv3nml\_ens\_stoch\_seeds module +===================================== + +.. automodule:: set_fv3nml_ens_stoch_seeds + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/TechDocs/ush/set_fv3nml_sfc_climo_filenames.rst b/doc/TechDocs/ush/set_fv3nml_sfc_climo_filenames.rst new file mode 100644 index 0000000000..bc0a942e82 --- /dev/null +++ b/doc/TechDocs/ush/set_fv3nml_sfc_climo_filenames.rst @@ -0,0 +1,7 @@ +set\_fv3nml\_sfc\_climo\_filenames module +========================================= + +.. automodule:: set_fv3nml_sfc_climo_filenames + :members: + :undoc-members: + :show-inheritance: From fa3e59d35b749cfe5caf88daec21a3ba34faa54a Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 19:34:36 -0500 Subject: [PATCH 25/55] capture git diff output? --- .github/scripts/update_tech_doc.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/scripts/update_tech_doc.sh b/.github/scripts/update_tech_doc.sh index 7bf1c7af2e..26ffbe9ff1 100755 --- a/.github/scripts/update_tech_doc.sh +++ b/.github/scripts/update_tech_doc.sh @@ -12,15 +12,16 @@ sudo apt-get install python3-sphinx-rtd-theme cd doc/TechDocs rm -rf ush rm -rf tests/WE2E -echo $PWD # Regenerate tech docs in ush and tests/WE2E based on current state of scripts in those directories. sphinx-apidoc -fM -o ./ush ../../ush sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E -ls # Check for mismatch between what comes out of this action and what is in the PR. -git diff +diff = $(git diff) +echo "${diff} + +# Check output from git diff command^ Why no diff on calculate_cost.rst? # May be able eventually to add an action that adds the properly built docs to the PR or the target branch From 86377a8270398ff65462550a49991150a30a138a Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 19:46:16 -0500 Subject: [PATCH 26/55] get git diff output? --- .github/scripts/update_tech_doc.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/scripts/update_tech_doc.sh b/.github/scripts/update_tech_doc.sh index 26ffbe9ff1..8903a81e1c 100755 --- a/.github/scripts/update_tech_doc.sh +++ b/.github/scripts/update_tech_doc.sh @@ -7,6 +7,8 @@ # Install prerequisites sudo apt-get install python3-sphinx sudo apt-get install python3-sphinx-rtd-theme +# sudo apt-get install python-sphinxcontrib-bibtex +pip install sphinxcontrib-bibtex # Remove existing directories cd doc/TechDocs @@ -16,9 +18,10 @@ rm -rf tests/WE2E # Regenerate tech docs in ush and tests/WE2E based on current state of scripts in those directories. sphinx-apidoc -fM -o ./ush ../../ush sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E +ls ush # Check for mismatch between what comes out of this action and what is in the PR. -diff = $(git diff) +diff=`git diff` echo "${diff} # Check output from git diff command^ Why no diff on calculate_cost.rst? From 41ace758547227682c8d509fd8c2b0746b3e9508 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 19:49:46 -0500 Subject: [PATCH 27/55] close quotes --- .github/scripts/update_tech_doc.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/scripts/update_tech_doc.sh b/.github/scripts/update_tech_doc.sh index 8903a81e1c..c709d52334 100755 --- a/.github/scripts/update_tech_doc.sh +++ b/.github/scripts/update_tech_doc.sh @@ -7,7 +7,6 @@ # Install prerequisites sudo apt-get install python3-sphinx sudo apt-get install python3-sphinx-rtd-theme -# sudo apt-get install python-sphinxcontrib-bibtex pip install sphinxcontrib-bibtex # Remove existing directories @@ -22,7 +21,7 @@ ls ush # Check for mismatch between what comes out of this action and what is in the PR. diff=`git diff` -echo "${diff} +echo "${diff}" # Check output from git diff command^ Why no diff on calculate_cost.rst? From eb88b2ba5824154e983de9851eba797d478c9f50 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 19:55:39 -0500 Subject: [PATCH 28/55] add warn as error --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index c91f2f147b..9663ba3996 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,6 +1,6 @@ # Makefile for Sphinx documentation -SPHINXOPTS = -a -n #-W +SPHINXOPTS = -a -n -W SPHINXBUILD = sphinx-build SOURCEDIR = . BUILDDIR = build From 163cc976c028f780817e089a45f0b06e02086cfc Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 19:56:04 -0500 Subject: [PATCH 29/55] nitpick ignore Basemap --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 340b9948e1..5989ae0d74 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -38,7 +38,7 @@ nitpick_ignore = [('py:class', 'obj'),('py:class', 'yaml.dumper.Dumper'),('py:class', - 'xml.etree.ElementTree'),] + 'xml.etree.ElementTree'),('py:class', 'Basemap'),] # -- General configuration --------------------------------------------------- From 9ff3632695a5479699ea40bcfd6b7203b1d89bf2 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 20:07:25 -0500 Subject: [PATCH 30/55] fix link --- doc/UsersGuide/CustomizingTheWorkflow/DefineWorkflow.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/UsersGuide/CustomizingTheWorkflow/DefineWorkflow.rst b/doc/UsersGuide/CustomizingTheWorkflow/DefineWorkflow.rst index 4ea8f7052d..b5d587969e 100644 --- a/doc/UsersGuide/CustomizingTheWorkflow/DefineWorkflow.rst +++ b/doc/UsersGuide/CustomizingTheWorkflow/DefineWorkflow.rst @@ -6,7 +6,7 @@ Defining an SRW App Workflow Many predefined workflows with optional variants exist within the Short-Range Weather Application, but the Application also includes the ability to define a new workflow from scratch. This functionality allows users to add tasks to the workflow to meet their scientific exploration needs. -Rocoto is the primary workflow manager software used by the UFS SRW App. Rocoto workflows are defined in an XML file (``FV3LAM_wflow.xml``) based on parameters set during experiment generation. This section explains how the Rocoto XML is built using a Jinja2 template (`Jinja docs here `__) and structured YAML files. The YAML follows the requirements in the `Rocoto documentation `__ with a few exceptions or additions outlined in this documentation. +Rocoto is the primary workflow manager software used by the UFS SRW App. Rocoto workflows are defined in an XML file (``FV3LAM_wflow.xml``) based on parameters set during experiment generation. This section explains how the Rocoto XML is built using a Jinja2 template (`Jinja docs here `_) and structured YAML files. The YAML follows the requirements in the `Rocoto documentation `__ with a few exceptions or additions outlined in this documentation. The Jinja2 Template =================== From a8849263914ff42194ea0282b94deff8f30d6974 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Sun, 3 Nov 2024 20:14:13 -0500 Subject: [PATCH 31/55] add git status --- .github/scripts/update_tech_doc.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/scripts/update_tech_doc.sh b/.github/scripts/update_tech_doc.sh index c709d52334..49e9be1c12 100755 --- a/.github/scripts/update_tech_doc.sh +++ b/.github/scripts/update_tech_doc.sh @@ -22,6 +22,8 @@ ls ush # Check for mismatch between what comes out of this action and what is in the PR. diff=`git diff` echo "${diff}" +git status + # Check output from git diff command^ Why no diff on calculate_cost.rst? From 9fdfcbd5d56354e0b7901db3dd2cdccc5be9d73c Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 14:56:28 -0500 Subject: [PATCH 32/55] check git status output --- .github/scripts/update_tech_doc.sh | 16 ++++++++++++---- .github/workflows/doc_tests.yaml | 2 ++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/scripts/update_tech_doc.sh b/.github/scripts/update_tech_doc.sh index 49e9be1c12..8b3e9b72d4 100755 --- a/.github/scripts/update_tech_doc.sh +++ b/.github/scripts/update_tech_doc.sh @@ -17,13 +17,21 @@ rm -rf tests/WE2E # Regenerate tech docs in ush and tests/WE2E based on current state of scripts in those directories. sphinx-apidoc -fM -o ./ush ../../ush sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E -ls ush # Check for mismatch between what comes out of this action and what is in the PR. -diff=`git diff` +diff=`git diff ${BRANCH_NAME} origin/develop` echo "${diff}" -git status - +status=`git status` +echo "${status}" + +if [ -n status ]; then + echo "${status}" + echo "Please update your Technical Documentation RST files." + exit 1 +else + echo "Technical documentation is up-to-date." + exit 0 +fi # Check output from git diff command^ Why no diff on calculate_cost.rst? diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index caaf875b6f..1c83ff095d 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -16,6 +16,8 @@ on: jobs: doc_tests: runs-on: ubuntu-latest + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} steps: - name: Checkout repository uses: actions/checkout@v4 From 6e2d202cc0e532afd1055435d75aeea084d2d9a0 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 15:37:46 -0500 Subject: [PATCH 33/55] clean up & rename check_tech_doc.sh --- .../{update_tech_doc.sh => check_tech_doc.sh} | 17 +++-------------- .github/workflows/doc_tests.yaml | 6 ++---- 2 files changed, 5 insertions(+), 18 deletions(-) rename .github/scripts/{update_tech_doc.sh => check_tech_doc.sh} (54%) diff --git a/.github/scripts/update_tech_doc.sh b/.github/scripts/check_tech_doc.sh similarity index 54% rename from .github/scripts/update_tech_doc.sh rename to .github/scripts/check_tech_doc.sh index 8b3e9b72d4..f6c3bb5c1a 100755 --- a/.github/scripts/update_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -1,8 +1,6 @@ #!/bin/bash -# This script rebuilds technical documentation for the ush and tests/WE2E Python scripts -# The build will fail if there are warnings. -# Warnings may be caused by incomplete or nonexistent documentation -# as well as by minor issues such as broken external links that need to be fixed or removed +# This script recreates technical documentation for the ush and tests/WE2E Python scripts +# If the tech docs produced here do not match the branch's contents, the script will fail # Install prerequisites sudo apt-get install python3-sphinx @@ -19,22 +17,13 @@ sphinx-apidoc -fM -o ./ush ../../ush sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E # Check for mismatch between what comes out of this action and what is in the PR. -diff=`git diff ${BRANCH_NAME} origin/develop` -echo "${diff}" status=`git status` -echo "${status}" if [ -n status ]; then - echo "${status}" + echo "${status}\n" echo "Please update your Technical Documentation RST files." exit 1 else echo "Technical documentation is up-to-date." exit 0 fi - -# Check output from git diff command^ Why no diff on calculate_cost.rst? - - -# May be able eventually to add an action that adds the properly built docs to the PR or the target branch - diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index 1c83ff095d..59595bcbaa 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -16,13 +16,11 @@ on: jobs: doc_tests: runs-on: ubuntu-latest - env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Update tech docs - run: .github/scripts/update_tech_doc.sh + - name: Check tech docs + run: .github/scripts/check_tech_doc.sh - name: Build documentation run: | cd doc From 2b08b874141ad47f78539f7b628e31ee30149168 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 15:40:41 -0500 Subject: [PATCH 34/55] add calculate_cost.rst back for testing --- doc/TechDocs/ush/calculate_cost.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/TechDocs/ush/calculate_cost.rst diff --git a/doc/TechDocs/ush/calculate_cost.rst b/doc/TechDocs/ush/calculate_cost.rst new file mode 100644 index 0000000000..aa85031292 --- /dev/null +++ b/doc/TechDocs/ush/calculate_cost.rst @@ -0,0 +1,7 @@ +calculate\_cost module +====================== + +.. automodule:: calculate_cost + :members: + :undoc-members: + :show-inheritance: From cff48293ceb13c15ba5b753bad79906fb55cf97c Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 16:03:37 -0500 Subject: [PATCH 35/55] use short git status --- .github/scripts/check_tech_doc.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index f6c3bb5c1a..22094dfe52 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -17,10 +17,11 @@ sphinx-apidoc -fM -o ./ush ../../ush sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E # Check for mismatch between what comes out of this action and what is in the PR. -status=`git status` +status=`git status -s` if [ -n status ]; then - echo "${status}\n" + echo "${status}" + echo "" echo "Please update your Technical Documentation RST files." exit 1 else From cb19a8e5323aed4c137563665dcdbf1f01d2d90a Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 16:10:47 -0500 Subject: [PATCH 36/55] fix git status command? --- .github/scripts/check_tech_doc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index 22094dfe52..584eab5899 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -19,7 +19,7 @@ sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E # Check for mismatch between what comes out of this action and what is in the PR. status=`git status -s` -if [ -n status ]; then +if [ status ]; then echo "${status}" echo "" echo "Please update your Technical Documentation RST files." From 97a09fb4c2fb927f64678bc119477efde6993672 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 16:14:58 -0500 Subject: [PATCH 37/55] fix bash variable ref --- .github/scripts/check_tech_doc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index 584eab5899..70edc6cd86 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -19,7 +19,7 @@ sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E # Check for mismatch between what comes out of this action and what is in the PR. status=`git status -s` -if [ status ]; then +if [ -n ${status} ]; then echo "${status}" echo "" echo "Please update your Technical Documentation RST files." From 602c9e9e5003337b8d97f409ef7d04330919c947 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 16:17:33 -0500 Subject: [PATCH 38/55] troubleshooting git status --- .github/scripts/check_tech_doc.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index 70edc6cd86..41e6cb8da5 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -18,6 +18,7 @@ sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E # Check for mismatch between what comes out of this action and what is in the PR. status=`git status -s` +echo "...${status}..." if [ -n ${status} ]; then echo "${status}" From 1567d4b34f128183f616a0409e3fe6da88596566 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 16:33:26 -0500 Subject: [PATCH 39/55] troubleshooting status --- .github/scripts/check_tech_doc.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index 41e6cb8da5..82e06e4915 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -20,12 +20,14 @@ sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E status=`git status -s` echo "...${status}..." -if [ -n ${status} ]; then - echo "${status}" +if [ -n "${status}" ]; then + echo ${status} + echo "Status size is: ${#status}." echo "" echo "Please update your Technical Documentation RST files." exit 1 else + echo "Status size is: ${#status}." echo "Technical documentation is up-to-date." exit 0 fi From bca0f5d554054eefffd22611748780e689a9a818 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Mon, 4 Nov 2024 16:35:28 -0500 Subject: [PATCH 40/55] clean up check_tech_doc.sh --- .github/scripts/check_tech_doc.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index 82e06e4915..a72e078684 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -18,16 +18,13 @@ sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E # Check for mismatch between what comes out of this action and what is in the PR. status=`git status -s` -echo "...${status}..." if [ -n "${status}" ]; then echo ${status} - echo "Status size is: ${#status}." echo "" echo "Please update your Technical Documentation RST files." exit 1 else - echo "Status size is: ${#status}." echo "Technical documentation is up-to-date." exit 0 fi From e63979c28003e5de25fdbc4028dd5bcb4f46e392 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Tue, 5 Nov 2024 21:55:39 -0500 Subject: [PATCH 41/55] update requirements files --- doc/requirements.in | 2 +- doc/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/requirements.in b/doc/requirements.in index 26c778f4aa..75a70ab416 100644 --- a/doc/requirements.in +++ b/doc/requirements.in @@ -1,3 +1,3 @@ -sphinx>=6.0.0 +sphinx>=7.4.0 sphinx_rtd_theme sphinxcontrib-bibtex diff --git a/doc/requirements.txt b/doc/requirements.txt index 966f96f598..faa8455abe 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -48,7 +48,7 @@ six==1.16.0 # pybtex snowballstemmer==2.2.0 # via sphinx -sphinx==7.2.6 +sphinx==7.4.7 # via # -r requirements.in # sphinx-rtd-theme From eec39e83bcc55011142be02035c2f665e38b93af Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 19:58:21 -0500 Subject: [PATCH 42/55] update tech doc GA w/--remove-old --- .github/scripts/check_tech_doc.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index a72e078684..a73b47d011 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -7,14 +7,10 @@ sudo apt-get install python3-sphinx sudo apt-get install python3-sphinx-rtd-theme pip install sphinxcontrib-bibtex -# Remove existing directories -cd doc/TechDocs -rm -rf ush -rm -rf tests/WE2E - # Regenerate tech docs in ush and tests/WE2E based on current state of scripts in those directories. -sphinx-apidoc -fM -o ./ush ../../ush -sphinx-apidoc -fM -o ./tests/WE2E ../../tests/WE2E +cd doc/TechDocs +sphinx-apidoc -fM --remove-old -o ./ush ../../ush +sphinx-apidoc -fM --remove-old -o ./tests/WE2E ../../tests/WE2E # Check for mismatch between what comes out of this action and what is in the PR. status=`git status -s` From 174a056c57eea57a967ff75d1f55e6dd562a327b Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 19:58:44 -0500 Subject: [PATCH 43/55] fix broken link in VX ch --- doc/UsersGuide/BuildingRunningTesting/VXCases.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/UsersGuide/BuildingRunningTesting/VXCases.rst b/doc/UsersGuide/BuildingRunningTesting/VXCases.rst index b36afcefd4..f8b01f993c 100644 --- a/doc/UsersGuide/BuildingRunningTesting/VXCases.rst +++ b/doc/UsersGuide/BuildingRunningTesting/VXCases.rst @@ -262,7 +262,8 @@ Point STAT Files The Point-Stat files contain continuous variables like temperature, pressure, and wind speed. A description of the Point-Stat file can be found :ref:`here ` in the MET documentation. -The Point-Stat files contain a potentially overwhelming amount of information. Therefore, it is recommended that users focus on the CNT MET test, which contains the `RMSE `_ and `MBIAS `_ statistics. The MET tests are defined in column 24 'LINE_TYPE' of the ``.stat`` file. Look for 'CNT' in this column. Then find column 66-68 for MBIAS and 78-80 for RMSE statistics. A full description of this file can be found :ref:`here `. +The Point-Stat files contain a potentially overwhelming amount of information. Therefore, it is recommended that users focus on the CNT MET test, which contains the Root Mean Squared Error (`RMSE `_) and Magnitude & +Multiplicative bias (`MBIAS `_) statistics. The MET tests are defined in column 24 'LINE_TYPE' of the ``.stat`` file. Look for 'CNT' in this column. Then find column 66-68 for MBIAS and 78-80 for RMSE statistics. A full description of this file can be found :ref:`here `. To narrow down the variable field even further, users can focus on these weather variables: From 11b8d7e2d03483bd07a607ae3cf87d6cf0a818a2 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 20:13:06 -0500 Subject: [PATCH 44/55] set -leo pipefail --- .github/workflows/doc_tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index 59595bcbaa..703ef371ea 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -9,9 +9,9 @@ on: branches: - 'feature/doc-actions' -#defaults: -# run: -# shell: bash -leo pipefail {0} +defaults: + run: + shell: bash -leo pipefail {0} jobs: doc_tests: From baa3556fa1c3ecf21790a7dedcb542451266ff37 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 20:16:50 -0500 Subject: [PATCH 45/55] set -eo pipefail --- .github/scripts/check_tech_doc.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index a73b47d011..d988e50cd6 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -2,9 +2,11 @@ # This script recreates technical documentation for the ush and tests/WE2E Python scripts # If the tech docs produced here do not match the branch's contents, the script will fail +set -eo pipefail + # Install prerequisites -sudo apt-get install python3-sphinx -sudo apt-get install python3-sphinx-rtd-theme +pip install sphinx +pip install sphinx-rtd-theme pip install sphinxcontrib-bibtex # Regenerate tech docs in ush and tests/WE2E based on current state of scripts in those directories. From 2a5d419a6b6f86b107e95263696b60e13316b532 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 20:20:02 -0500 Subject: [PATCH 46/55] specify sphinx version --- .github/scripts/check_tech_doc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index d988e50cd6..377afceaa0 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -5,7 +5,7 @@ set -eo pipefail # Install prerequisites -pip install sphinx +pip install sphinx>=7.4 pip install sphinx-rtd-theme pip install sphinxcontrib-bibtex From 22e8d1d7675b338cf03ce5311298cf3c1f38d597 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 20:22:12 -0500 Subject: [PATCH 47/55] test pipefail --- .github/scripts/check_tech_doc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index 377afceaa0..d9d46e743f 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -5,8 +5,8 @@ set -eo pipefail # Install prerequisites -pip install sphinx>=7.4 -pip install sphinx-rtd-theme +sudo apt-get install python3-sphinx +sudo apt-get install python3-sphinx-rtd-theme pip install sphinxcontrib-bibtex # Regenerate tech docs in ush and tests/WE2E based on current state of scripts in those directories. From 88d4f0d36228b76e924d9e6532d1408d7bd44e39 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 20:24:46 -0500 Subject: [PATCH 48/55] add back pip instal sphinx --- .github/scripts/check_tech_doc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/check_tech_doc.sh b/.github/scripts/check_tech_doc.sh index d9d46e743f..d988e50cd6 100755 --- a/.github/scripts/check_tech_doc.sh +++ b/.github/scripts/check_tech_doc.sh @@ -5,8 +5,8 @@ set -eo pipefail # Install prerequisites -sudo apt-get install python3-sphinx -sudo apt-get install python3-sphinx-rtd-theme +pip install sphinx +pip install sphinx-rtd-theme pip install sphinxcontrib-bibtex # Regenerate tech docs in ush and tests/WE2E based on current state of scripts in those directories. From 3416c15549abf681dce6c98d6170010101caef22 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 20:29:41 -0500 Subject: [PATCH 49/55] testing new PY file w/o RST --- ush/test.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 ush/test.py diff --git a/ush/test.py b/ush/test.py new file mode 100644 index 0000000000..35180fc812 --- /dev/null +++ b/ush/test.py @@ -0,0 +1 @@ +"""Tests docstring & GitHub Sctions functionality""" From af116fbf699ec47f54be52e8a75e38cefd80b1bb Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 20:31:52 -0500 Subject: [PATCH 50/55] test modules.rst w/o calc_cost listed --- doc/TechDocs/ush/modules.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/TechDocs/ush/modules.rst b/doc/TechDocs/ush/modules.rst index 2070e75ad0..446f2add9f 100644 --- a/doc/TechDocs/ush/modules.rst +++ b/doc/TechDocs/ush/modules.rst @@ -5,7 +5,6 @@ ush :maxdepth: 4 UFS_plot_domains - calculate_cost check_python_version config_utils create_aqm_rc_file @@ -26,4 +25,5 @@ ush set_gridparams_GFDLgrid set_predef_grid_params setup + test update_input_nml From 3018cab5c91bd535bcaf346c6cd5720222f594af Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 20:33:24 -0500 Subject: [PATCH 51/55] test modules.rst w/o calc_cost listed but w/test.rst --- doc/TechDocs/ush/test.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/TechDocs/ush/test.rst diff --git a/doc/TechDocs/ush/test.rst b/doc/TechDocs/ush/test.rst new file mode 100644 index 0000000000..206500f290 --- /dev/null +++ b/doc/TechDocs/ush/test.rst @@ -0,0 +1,7 @@ +test module +=========== + +.. automodule:: test + :members: + :undoc-members: + :show-inheritance: From c5a32fb9b7b2433de90e5b0ebd61991cd146fba2 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Wed, 6 Nov 2024 20:38:41 -0500 Subject: [PATCH 52/55] rm test.py; update modules.rst for passing test --- doc/TechDocs/ush/modules.rst | 2 +- doc/TechDocs/ush/test.rst | 7 ------- ush/test.py | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 doc/TechDocs/ush/test.rst delete mode 100644 ush/test.py diff --git a/doc/TechDocs/ush/modules.rst b/doc/TechDocs/ush/modules.rst index 446f2add9f..2070e75ad0 100644 --- a/doc/TechDocs/ush/modules.rst +++ b/doc/TechDocs/ush/modules.rst @@ -5,6 +5,7 @@ ush :maxdepth: 4 UFS_plot_domains + calculate_cost check_python_version config_utils create_aqm_rc_file @@ -25,5 +26,4 @@ ush set_gridparams_GFDLgrid set_predef_grid_params setup - test update_input_nml diff --git a/doc/TechDocs/ush/test.rst b/doc/TechDocs/ush/test.rst deleted file mode 100644 index 206500f290..0000000000 --- a/doc/TechDocs/ush/test.rst +++ /dev/null @@ -1,7 +0,0 @@ -test module -=========== - -.. automodule:: test - :members: - :undoc-members: - :show-inheritance: diff --git a/ush/test.py b/ush/test.py deleted file mode 100644 index 35180fc812..0000000000 --- a/ush/test.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests docstring & GitHub Sctions functionality""" From bd32d4a7312cc6620460ec528a4ff8c8e1fac553 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Thu, 7 Nov 2024 11:48:50 -0500 Subject: [PATCH 53/55] update Contrib Guide w/info on documentation/tech docs --- doc/ContribGuide/documentation.rst | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/doc/ContribGuide/documentation.rst b/doc/ContribGuide/documentation.rst index 9e0bad6bda..2c3056d2e2 100644 --- a/doc/ContribGuide/documentation.rst +++ b/doc/ContribGuide/documentation.rst @@ -69,4 +69,34 @@ Please follow these guidelines when contributing to the documentation: .. code-block:: python - n = 88 \ No newline at end of file + n = 88 + +Troubleshooting Documentation +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In the SRW App documentation Makefile (``ufs-srweather-app/doc/Makefile``), the ``-W`` option causes documentation builds to fail when there are errors or warnings in the build. +This ensures that the documentation remains up-to-date and notifies developers of any new issues (like failing links). However, the build will fail when it hits the first error without showing subsequent errors. +When troubleshooting, it can be useful to see all warnings and errors. +To see all warnings and errors, comment out the ``-W`` flag in ``SPHINXOPTS`` in the Makefile and build the documentation by running ``make doc`` from the ``doc`` directory. + +Technical Documentation Guidelines +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Technical (API-like) documentation is generated for any Python scripts in the ``ush`` or ``tests/WE2E`` directories. +When developers change Python files in these directories, they need to update the Python docstrings (i.e., comments in """triple quotes""") to reflect the changes they made. +Each Python script should include: + + * A summary of the script's purpose/functionality + + * Should start with a verb, e.g., "checks" or "loads" or "initializes" + + * Docstrings for each method (except methods like ``_parse_args`` that start with an underscore). These docstrings should include: + + * A description of what the method does (starting with a verb, e.g., "checks" or "parses") + * A list of method parameters, or ``Args:``, with a definition and expected data type for each + * A return statement (``Returns:``) --- if applicable + * List of exceptions (``Raises:``) --- if applicable + +.. note:: + + Python does not have truly private methods, but methods that start with an underscore are the closest equivalent. In the SRW App, the underscore signals that this method is only accessed by the script within which it is called. \ No newline at end of file From 4e71ec78ab6e65ad0f625e4ae8fe41bdca3a7513 Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Tue, 12 Nov 2024 08:48:50 -0500 Subject: [PATCH 54/55] add instructions for tech doc updates --- doc/ContribGuide/documentation.rst | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/doc/ContribGuide/documentation.rst b/doc/ContribGuide/documentation.rst index 2c3056d2e2..babcd24368 100644 --- a/doc/ContribGuide/documentation.rst +++ b/doc/ContribGuide/documentation.rst @@ -83,7 +83,7 @@ Technical Documentation Guidelines ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Technical (API-like) documentation is generated for any Python scripts in the ``ush`` or ``tests/WE2E`` directories. -When developers change Python files in these directories, they need to update the Python docstrings (i.e., comments in """triple quotes""") to reflect the changes they made. +When developers change Python files in these directories, they need to update the Python docstrings (i.e., comments in ``"""triple quotes"""``) to reflect the changes they made. Each Python script should include: * A summary of the script's purpose/functionality @@ -94,9 +94,29 @@ Each Python script should include: * A description of what the method does (starting with a verb, e.g., "checks" or "parses") * A list of method parameters, or ``Args:``, with a definition and expected data type for each - * A return statement (``Returns:``) --- if applicable - * List of exceptions (``Raises:``) --- if applicable + * A return statement (``Returns:``) -- if applicable + * List of exceptions (``Raises:``) -- if applicable .. note:: - Python does not have truly private methods, but methods that start with an underscore are the closest equivalent. In the SRW App, the underscore signals that this method is only accessed by the script within which it is called. \ No newline at end of file + Python does not have truly private methods, but methods that start with an underscore are the closest equivalent. In the SRW App, the underscore signals that this method is only accessed by the script within which it is called. + +After updating the docstrings, developers need to update the corresponding RST files. +To do this successfully, developers must have *sphinx>=7.4.0* installed on their system. To update the RST files, run: + +.. code-block:: console + + cd ufs-srweather-app/doc/TechDoc + sphinx-apidoc -fM --remove-old -o ./ush ../../ush + sphinx-apidoc -fM --remove-old -o ./tests/WE2E ../../tests/WE2E + +.. note:: + + Developers who do not have *sphinx>=7.4.0* installed may issue the following commands from ``ufs-srweather-app/doc/TechDoc`` before running the sphinx-apidoc commands above: + + .. code-block:: console + + rm -rf ush + rm -rf tests/WE2E + + This will delete current RST files before recreating them with the ``sphinx-apidoc`` command based on the current contents of ``ush`` and ``tests/WE2E``. This step is necessary because the ``--remove-old`` flag does not work with earlier versions of sphinx. From eb84a1747ea1b5d39ac6bd3b80f6e9ab0abc63cf Mon Sep 17 00:00:00 2001 From: gspetro-NOAA Date: Tue, 12 Nov 2024 12:42:01 -0500 Subject: [PATCH 55/55] rm wflow dispatch option on feature/doc-actions branch --- .github/workflows/doc_tests.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/doc_tests.yaml b/.github/workflows/doc_tests.yaml index 703ef371ea..34fb01a9ac 100644 --- a/.github/workflows/doc_tests.yaml +++ b/.github/workflows/doc_tests.yaml @@ -6,8 +6,6 @@ on: - develop - 'release/*' workflow_dispatch: - branches: - - 'feature/doc-actions' defaults: run: