From 42208102afc953fb525c1d6a46b61f9b0cceb8c6 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 15 Jan 2024 09:39:28 +0100 Subject: [PATCH 1/2] Use PyAnsys doc style action --- .github/workflows/docs-style.yml | 31 ------------------------------- .github/workflows/docs.yml | 11 +++++++---- 2 files changed, 7 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/docs-style.yml diff --git a/.github/workflows/docs-style.yml b/.github/workflows/docs-style.yml deleted file mode 100644 index 5aff72e54..000000000 --- a/.github/workflows/docs-style.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Check documentation with Vale -name: Documentation Style Check - -on: - workflow_call: - inputs: - vale_reporter: - description: "Vale reporter to use" - required: false - type: string - default: 'local' - workflow_dispatch: - -jobs: - docs-style: - name: Documentation Style Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Running Vale - uses: errata-ai/vale-action@reviewdog - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - files: docs - reporter: ${{ inputs.vale_reporter || 'local' }} - level: error - filter_mode: nofilter - fail_on_error: true - vale_flags: "--config=docs/.vale.ini" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 21104956f..993d85eb1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -60,10 +60,13 @@ env: jobs: doc-style: name: "Check doc style" - uses: ./.github/workflows/docs-style.yml - with: - vale_reporter: ${{ (inputs.event_name == 'pull_request') && 'github-check' || 'local' }} - secrets: inherit + runs-on: ubuntu-latest + steps: + - name: "Running documentation style checks" + uses: ansys/actions/doc-style@v5.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + vale-config: "docs/.vale.ini" docs: name: "Documentation" From 4fc8ee3397620bd2cb00d0405b510b1e12bb2315 Mon Sep 17 00:00:00 2001 From: "paul.profizi" Date: Mon, 15 Jan 2024 11:02:51 +0100 Subject: [PATCH 2/2] Move docs to doc --- .github/workflows/docs.yml | 17 ++-- .gitignore | 6 +- .pre-commit-config.yaml | 4 +- codecov.yml | 2 +- {docs => doc}/.vale.ini | 86 +++++++++--------- {docs => doc}/Makefile | 0 {docs => doc}/make.bat | 0 {docs => doc}/source/api/index.rst | 0 {docs => doc}/source/api/result_data.rst | 0 {docs => doc}/source/api/result_object.rst | 0 {docs => doc}/source/api/solution.rst | 0 {docs => doc}/source/conf.py | 0 {docs => doc}/source/contributing.rst | 0 .../source/getting_started/compatibility.rst | 0 .../source/getting_started/index.rst | 0 .../source/getting_started/install.rst | 0 .../source/images/crankshaft_disp.png | Bin .../source/images/crankshaft_stress.png | Bin .../source/images/crankshaft_stress_xx.png | Bin {docs => doc}/source/images/dpf-flow.png | Bin {docs => doc}/source/images/main_example.png | Bin {docs => doc}/source/index.rst | 0 .../source/pydpf-post_clone_install.rst | 0 .../user_guide/accessing_file_metadata.rst | 0 .../source/user_guide/accessing_results.rst | 0 .../source/user_guide/extending_to_core.rst | 0 {docs => doc}/source/user_guide/index.rst | 0 .../source/user_guide/known_issues_list.rst | 0 {docs => doc}/source/user_guide/plotting.rst | 0 .../source/user_guide/post_processing.rst | 0 .../source/user_guide/server_context.rst | 0 .../source/user_guide/troubleshooting.rst | 0 {docs => doc}/styles/.gitignore | 6 +- {docs => doc}/styles/Vocab/ANSYS/accept.txt | 34 +++---- {docs => doc}/styles/Vocab/ANSYS/reject.txt | 0 35 files changed, 77 insertions(+), 78 deletions(-) rename {docs => doc}/.vale.ini (95%) rename {docs => doc}/Makefile (100%) rename {docs => doc}/make.bat (100%) rename {docs => doc}/source/api/index.rst (100%) rename {docs => doc}/source/api/result_data.rst (100%) rename {docs => doc}/source/api/result_object.rst (100%) rename {docs => doc}/source/api/solution.rst (100%) rename {docs => doc}/source/conf.py (100%) mode change 100755 => 100644 rename {docs => doc}/source/contributing.rst (100%) rename {docs => doc}/source/getting_started/compatibility.rst (100%) rename {docs => doc}/source/getting_started/index.rst (100%) mode change 100755 => 100644 rename {docs => doc}/source/getting_started/install.rst (100%) rename {docs => doc}/source/images/crankshaft_disp.png (100%) rename {docs => doc}/source/images/crankshaft_stress.png (100%) rename {docs => doc}/source/images/crankshaft_stress_xx.png (100%) rename {docs => doc}/source/images/dpf-flow.png (100%) rename {docs => doc}/source/images/main_example.png (100%) rename {docs => doc}/source/index.rst (100%) rename {docs => doc}/source/pydpf-post_clone_install.rst (100%) rename {docs => doc}/source/user_guide/accessing_file_metadata.rst (100%) rename {docs => doc}/source/user_guide/accessing_results.rst (100%) rename {docs => doc}/source/user_guide/extending_to_core.rst (100%) rename {docs => doc}/source/user_guide/index.rst (100%) rename {docs => doc}/source/user_guide/known_issues_list.rst (100%) rename {docs => doc}/source/user_guide/plotting.rst (100%) rename {docs => doc}/source/user_guide/post_processing.rst (100%) rename {docs => doc}/source/user_guide/server_context.rst (100%) rename {docs => doc}/source/user_guide/troubleshooting.rst (100%) rename {docs => doc}/styles/.gitignore (90%) rename {docs => doc}/styles/Vocab/ANSYS/accept.txt (90%) rename {docs => doc}/styles/Vocab/ANSYS/reject.txt (100%) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 993d85eb1..370488ffc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -66,7 +66,6 @@ jobs: uses: ansys/actions/doc-style@v5.0 with: token: ${{ secrets.GITHUB_TOKEN }} - vale-config: "docs/.vale.ini" docs: name: "Documentation" @@ -122,11 +121,11 @@ jobs: shell: bash run: | export SPHINX_APIDOC_OPTIONS=inherited-members - sphinx-apidoc -o docs/source/api src/ansys ${{inputs.build_extras}} -f --implicit-namespaces --separate --no-headings $DEBUG_SPHINX + sphinx-apidoc -o doc/source/api src/ansys ${{inputs.build_extras}} -f --implicit-namespaces --separate --no-headings $DEBUG_SPHINX - name: "Build HTML Documentation" shell: bash - working-directory: docs + working-directory: doc run: | export TEMP=${{ runner.temp }} make clean @@ -135,7 +134,7 @@ jobs: - name: "Check for success" shell: bash - working-directory: docs + working-directory: doc run: | case `tail -n 5 log.txt | grep -F "build succeeded" >/dev/null; echo $?` in 0) @@ -151,7 +150,7 @@ jobs: - name: "Build PDF Documentation" shell: bash - working-directory: docs + working-directory: doc if: ${{ inputs.generate_pdf == 'true' }} run: | export TEMP=${{ runner.temp }} @@ -162,13 +161,13 @@ jobs: uses: actions/upload-artifact@v4 with: name: doc-${{env.PACKAGE_NAME}}-log - path: docs/*.txt + path: doc/*.txt if: always() - name: "Zip HTML Documentation" uses: vimtor/action-zip@v1.1 with: - files: docs/build/html/ + files: doc/build/html/ dest: HTML-doc-${{env.PACKAGE_NAME}}.zip if: always() @@ -183,7 +182,7 @@ jobs: shell: bash if: ${{ inputs.generate_pdf == 'true' }} id: pdf - working-directory: docs/build/latex + working-directory: doc/build/latex run: | pattern="PyDPF-*.pdf" files=( $pattern ) @@ -194,7 +193,7 @@ jobs: uses: vimtor/action-zip@v1.1 if: ${{ inputs.generate_pdf == 'true' }} with: - files: docs/build/latex/${{ steps.pdf.outputs.PDF_file }} + files: doc/build/latex/${{ steps.pdf.outputs.PDF_file }} dest: PDF-doc-${{env.PACKAGE_NAME}}.zip - name: "Upload PDF Documentation" diff --git a/.gitignore b/.gitignore index ae4721326..e6ec6c06f 100644 --- a/.gitignore +++ b/.gitignore @@ -71,9 +71,9 @@ instance/ .scrapy # Sphinx documentation -docs/build/ -docs/source/api/_autosummary -docs/source/examples +doc/build/ +doc/source/api/_autosummary +doc/source/examples # PyBuilder .pybuilder/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 40c4df8fc..44c585428 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ exclude: | (?x)^( - docs/styles/ + doc/styles/ ) repos: - repo: https://github.com/psf/black @@ -28,7 +28,7 @@ repos: hooks: - id: codespell args: [ - "docs src", + "doc src", "*.py *.rst *.md", ] exclude: conf.py diff --git a/codecov.yml b/codecov.yml index b2bf6e23d..24122cb56 100644 --- a/codecov.yml +++ b/codecov.yml @@ -15,5 +15,5 @@ coverage: if_no_uploads: error ignore: - "examples" # ignore folder and all its contents - - "docs" # ignore folder and all its contents + - "doc" # ignore folder and all its contents - "tests" # ignore folder and all its contents \ No newline at end of file diff --git a/docs/.vale.ini b/doc/.vale.ini similarity index 95% rename from docs/.vale.ini rename to doc/.vale.ini index ff459c4ea..ed2cfbee2 100644 --- a/docs/.vale.ini +++ b/doc/.vale.ini @@ -1,43 +1,43 @@ -# Core settings -# ============= - -# Location of our `styles` -StylesPath = "styles" - -# The options are `suggestion`, `warning`, or `error` (defaults to “warning”). -MinAlertLevel = warning - -# By default, `code` and `tt` are ignored. -IgnoredScopes = code, tt - -# By default, `script`, `style`, `pre`, and `figure` are ignored. -SkippedScopes = script, style, pre, figure - -# WordTemplate specifies what Vale will consider to be an individual word. -WordTemplate = \b(?:%s)\b - -# List of Packages to be used for our guidelines -Packages = Google - -# Define the Ansys vocabulary -Vocab = ANSYS - -[*.{md,rst}] - -# Apply the following styles -BasedOnStyles = Vale, Google - -# Removing Google-specific rule - Not applicable under some circumstances -Google.WordList = NO -Google.Colons = NO - -[formats] -# Format associations appear under -# the optional "formats" section. - -[*] -# Format-specific settings appear -# under a user-provided "glob" -# pattern. -TokenIgnores = (:.*:\x60.*\x60) - +# Core settings +# ============= + +# Location of our `styles` +StylesPath = "styles" + +# The options are `suggestion`, `warning`, or `error` (defaults to “warning”). +MinAlertLevel = warning + +# By default, `code` and `tt` are ignored. +IgnoredScopes = code, tt + +# By default, `script`, `style`, `pre`, and `figure` are ignored. +SkippedScopes = script, style, pre, figure + +# WordTemplate specifies what Vale will consider to be an individual word. +WordTemplate = \b(?:%s)\b + +# List of Packages to be used for our guidelines +Packages = Google + +# Define the Ansys vocabulary +Vocab = ANSYS + +[*.{md,rst}] + +# Apply the following styles +BasedOnStyles = Vale, Google + +# Removing Google-specific rule - Not applicable under some circumstances +Google.WordList = NO +Google.Colons = NO + +[formats] +# Format associations appear under +# the optional "formats" section. + +[*] +# Format-specific settings appear +# under a user-provided "glob" +# pattern. +TokenIgnores = (:.*:\x60.*\x60) + diff --git a/docs/Makefile b/doc/Makefile similarity index 100% rename from docs/Makefile rename to doc/Makefile diff --git a/docs/make.bat b/doc/make.bat similarity index 100% rename from docs/make.bat rename to doc/make.bat diff --git a/docs/source/api/index.rst b/doc/source/api/index.rst similarity index 100% rename from docs/source/api/index.rst rename to doc/source/api/index.rst diff --git a/docs/source/api/result_data.rst b/doc/source/api/result_data.rst similarity index 100% rename from docs/source/api/result_data.rst rename to doc/source/api/result_data.rst diff --git a/docs/source/api/result_object.rst b/doc/source/api/result_object.rst similarity index 100% rename from docs/source/api/result_object.rst rename to doc/source/api/result_object.rst diff --git a/docs/source/api/solution.rst b/doc/source/api/solution.rst similarity index 100% rename from docs/source/api/solution.rst rename to doc/source/api/solution.rst diff --git a/docs/source/conf.py b/doc/source/conf.py old mode 100755 new mode 100644 similarity index 100% rename from docs/source/conf.py rename to doc/source/conf.py diff --git a/docs/source/contributing.rst b/doc/source/contributing.rst similarity index 100% rename from docs/source/contributing.rst rename to doc/source/contributing.rst diff --git a/docs/source/getting_started/compatibility.rst b/doc/source/getting_started/compatibility.rst similarity index 100% rename from docs/source/getting_started/compatibility.rst rename to doc/source/getting_started/compatibility.rst diff --git a/docs/source/getting_started/index.rst b/doc/source/getting_started/index.rst old mode 100755 new mode 100644 similarity index 100% rename from docs/source/getting_started/index.rst rename to doc/source/getting_started/index.rst diff --git a/docs/source/getting_started/install.rst b/doc/source/getting_started/install.rst similarity index 100% rename from docs/source/getting_started/install.rst rename to doc/source/getting_started/install.rst diff --git a/docs/source/images/crankshaft_disp.png b/doc/source/images/crankshaft_disp.png similarity index 100% rename from docs/source/images/crankshaft_disp.png rename to doc/source/images/crankshaft_disp.png diff --git a/docs/source/images/crankshaft_stress.png b/doc/source/images/crankshaft_stress.png similarity index 100% rename from docs/source/images/crankshaft_stress.png rename to doc/source/images/crankshaft_stress.png diff --git a/docs/source/images/crankshaft_stress_xx.png b/doc/source/images/crankshaft_stress_xx.png similarity index 100% rename from docs/source/images/crankshaft_stress_xx.png rename to doc/source/images/crankshaft_stress_xx.png diff --git a/docs/source/images/dpf-flow.png b/doc/source/images/dpf-flow.png similarity index 100% rename from docs/source/images/dpf-flow.png rename to doc/source/images/dpf-flow.png diff --git a/docs/source/images/main_example.png b/doc/source/images/main_example.png similarity index 100% rename from docs/source/images/main_example.png rename to doc/source/images/main_example.png diff --git a/docs/source/index.rst b/doc/source/index.rst similarity index 100% rename from docs/source/index.rst rename to doc/source/index.rst diff --git a/docs/source/pydpf-post_clone_install.rst b/doc/source/pydpf-post_clone_install.rst similarity index 100% rename from docs/source/pydpf-post_clone_install.rst rename to doc/source/pydpf-post_clone_install.rst diff --git a/docs/source/user_guide/accessing_file_metadata.rst b/doc/source/user_guide/accessing_file_metadata.rst similarity index 100% rename from docs/source/user_guide/accessing_file_metadata.rst rename to doc/source/user_guide/accessing_file_metadata.rst diff --git a/docs/source/user_guide/accessing_results.rst b/doc/source/user_guide/accessing_results.rst similarity index 100% rename from docs/source/user_guide/accessing_results.rst rename to doc/source/user_guide/accessing_results.rst diff --git a/docs/source/user_guide/extending_to_core.rst b/doc/source/user_guide/extending_to_core.rst similarity index 100% rename from docs/source/user_guide/extending_to_core.rst rename to doc/source/user_guide/extending_to_core.rst diff --git a/docs/source/user_guide/index.rst b/doc/source/user_guide/index.rst similarity index 100% rename from docs/source/user_guide/index.rst rename to doc/source/user_guide/index.rst diff --git a/docs/source/user_guide/known_issues_list.rst b/doc/source/user_guide/known_issues_list.rst similarity index 100% rename from docs/source/user_guide/known_issues_list.rst rename to doc/source/user_guide/known_issues_list.rst diff --git a/docs/source/user_guide/plotting.rst b/doc/source/user_guide/plotting.rst similarity index 100% rename from docs/source/user_guide/plotting.rst rename to doc/source/user_guide/plotting.rst diff --git a/docs/source/user_guide/post_processing.rst b/doc/source/user_guide/post_processing.rst similarity index 100% rename from docs/source/user_guide/post_processing.rst rename to doc/source/user_guide/post_processing.rst diff --git a/docs/source/user_guide/server_context.rst b/doc/source/user_guide/server_context.rst similarity index 100% rename from docs/source/user_guide/server_context.rst rename to doc/source/user_guide/server_context.rst diff --git a/docs/source/user_guide/troubleshooting.rst b/doc/source/user_guide/troubleshooting.rst similarity index 100% rename from docs/source/user_guide/troubleshooting.rst rename to doc/source/user_guide/troubleshooting.rst diff --git a/docs/styles/.gitignore b/doc/styles/.gitignore similarity index 90% rename from docs/styles/.gitignore rename to doc/styles/.gitignore index 943db7cb5..080f12aa4 100644 --- a/docs/styles/.gitignore +++ b/doc/styles/.gitignore @@ -1,4 +1,4 @@ -* -!Vocab -!Vocab/** +* +!Vocab +!Vocab/** !.gitignore \ No newline at end of file diff --git a/docs/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt similarity index 90% rename from docs/styles/Vocab/ANSYS/accept.txt rename to doc/styles/Vocab/ANSYS/accept.txt index d966e16f1..386d8b250 100644 --- a/docs/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -1,17 +1,17 @@ -[Aa]nsys -[Cc]ore -[Pp]ost -ANSYS -API -HDF5 -postprocess -postprocessing -(PyDPF\s|PyDPF-Core|PyDPF-Post) -Pythonic -R1 -R2 -subresult -subresults -Thermal/electric -UTF-8 -VTK +[Aa]nsys +[Cc]ore +[Pp]ost +ANSYS +API +HDF5 +postprocess +postprocessing +(PyDPF\s|PyDPF-Core|PyDPF-Post) +Pythonic +R1 +R2 +subresult +subresults +Thermal/electric +UTF-8 +VTK diff --git a/docs/styles/Vocab/ANSYS/reject.txt b/doc/styles/Vocab/ANSYS/reject.txt similarity index 100% rename from docs/styles/Vocab/ANSYS/reject.txt rename to doc/styles/Vocab/ANSYS/reject.txt