From 90a3e7fe0b825d6d81a94f7ba3ab0f91dded40d4 Mon Sep 17 00:00:00 2001 From: John Vouvakis Manousakis Date: Sun, 18 Aug 2024 10:20:09 -0700 Subject: [PATCH 1/6] Update codespell workflow. Update codespell workflow to use [actions-codespell](https://github.com/codespell-project/actions-codespell). --- .github/workflows/spell_check.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index e21f80b37..1b520e1fc 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -7,19 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - - name: Install codespell - run: | - python -m pip install --upgrade pip - pip install tomli codespell - - name: Run codespell - run: | - codespell . + uses: codespell-project/actions-codespell@v2 + From 330bba5d3ca86a20b57e60815f0d986151e5d179 Mon Sep 17 00:00:00 2001 From: John Vouvakis Manousakis Date: Sun, 18 Aug 2024 10:27:58 -0700 Subject: [PATCH 2/6] Add typo Add typo to see if workflow would pick it up. --- .github/workflows/spell_check.yml | 1 - modules/performUQ/common/parallel_runner_mpi4py.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index 1b520e1fc..0e920f48c 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -9,4 +9,3 @@ jobs: steps: - name: Run codespell uses: codespell-project/actions-codespell@v2 - diff --git a/modules/performUQ/common/parallel_runner_mpi4py.py b/modules/performUQ/common/parallel_runner_mpi4py.py index bf8de20bc..44927f722 100644 --- a/modules/performUQ/common/parallel_runner_mpi4py.py +++ b/modules/performUQ/common/parallel_runner_mpi4py.py @@ -1,6 +1,7 @@ from mpi4py import MPI # noqa: INP001, D100 from mpi4py.futures import MPIPoolExecutor +# aceleration should be acceleration class ParallelRunnerMPI4PY: # noqa: D101 def __init__(self, run_type: str = 'runningRemote') -> None: From a8396ad0d62d755857fed6691951b86b81d8bff3 Mon Sep 17 00:00:00 2001 From: John Vouvakis Manousakis Date: Sun, 18 Aug 2024 10:30:20 -0700 Subject: [PATCH 3/6] Add back `checkout` block. --- .github/workflows/spell_check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index 0e920f48c..c894573a1 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -7,5 +7,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Run codespell uses: codespell-project/actions-codespell@v2 + From 85ed9527a3812ceeee82c32c9e9fe7c7a2687007 Mon Sep 17 00:00:00 2001 From: John Vouvakis Manousakis Date: Sun, 18 Aug 2024 10:31:20 -0700 Subject: [PATCH 4/6] Awesome. Remove typo. Remove typo. We are done here. --- modules/performUQ/common/parallel_runner_mpi4py.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/performUQ/common/parallel_runner_mpi4py.py b/modules/performUQ/common/parallel_runner_mpi4py.py index 44927f722..64bbb4a6d 100644 --- a/modules/performUQ/common/parallel_runner_mpi4py.py +++ b/modules/performUQ/common/parallel_runner_mpi4py.py @@ -1,8 +1,6 @@ from mpi4py import MPI # noqa: INP001, D100 from mpi4py.futures import MPIPoolExecutor -# aceleration should be acceleration - class ParallelRunnerMPI4PY: # noqa: D101 def __init__(self, run_type: str = 'runningRemote') -> None: self.run_type = run_type From 8ae17d429e081a46e7e302d1958d5e5541404768 Mon Sep 17 00:00:00 2001 From: John Vouvakis Manousakis Date: Wed, 28 Aug 2024 05:05:09 -0700 Subject: [PATCH 5/6] Pin Ruff version to 0.6.1 We'll need to keep an eye on Ruff releases and manually update the version when we deem it appropriate. --- .github/workflows/format_check.yml | 1 + .github/workflows/lint.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/workflows/format_check.yml b/.github/workflows/format_check.yml index dca19a00f..f779ab252 100644 --- a/.github/workflows/format_check.yml +++ b/.github/workflows/format_check.yml @@ -8,3 +8,4 @@ jobs: - uses: chartboost/ruff-action@v1 with: args: 'format --check' + version: 0.6.1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 744b4e642..be42eccfe 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,3 +6,5 @@ jobs: steps: - uses: actions/checkout@v4 - uses: chartboost/ruff-action@v1 + with: + version: 0.6.1 From 62cf6be3ba95911504c69b73ef99aab11697ffe8 Mon Sep 17 00:00:00 2001 From: John Vouvakis Manousakis Date: Wed, 28 Aug 2024 05:08:16 -0700 Subject: [PATCH 6/6] Format and lint --- modules/Workflow/createResponseCSV.py | 14 +++++++------- modules/performUQ/common/parallel_runner_mpi4py.py | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/Workflow/createResponseCSV.py b/modules/Workflow/createResponseCSV.py index e553398c3..557b14c80 100644 --- a/modules/Workflow/createResponseCSV.py +++ b/modules/Workflow/createResponseCSV.py @@ -1,4 +1,4 @@ -# noqa: D100 +# noqa: D100, INP001 # # Code to write response.csv file given input and dakotaTab.out files @@ -14,9 +14,9 @@ import numpy as np import pandas as pd -def main(input_file, dakota_tab_file): # noqa: D103 - directory_inputs = os.path.dirname(input_file) # noqa: PTH120 +def main(input_file, dakota_tab_file): # noqa: D103 + directory_inputs = os.path.dirname(input_file) # noqa: PTH120 os.chdir(directory_inputs) try: @@ -26,11 +26,11 @@ def main(input_file, dakota_tab_file): # noqa: D103 except FileNotFoundError: # Handle the error if the file is not found - print(f"Error createResponseCSV.py: The file '{input_file}' was not found.") # noqa: T201 + print(f"Error createResponseCSV.py: The file '{input_file}' was not found.") # noqa: T201 return except OSError: # Handle other I/O errors - print(f"Error createResponseCSV.py: Error reading the file '{input_file}'.") # noqa: T201 + print(f"Error createResponseCSV.py: Error reading the file '{input_file}'.") # noqa: T201 return app_data = data.get('Applications', None) @@ -59,12 +59,12 @@ def main(input_file, dakota_tab_file): # noqa: D103 except FileNotFoundError: # Handle the error if the file is not found - print(f"Error createResponseCSV.py: The file '{dakota_tab_file}' not found.") # noqa: T201 + print(f"Error createResponseCSV.py: The file '{dakota_tab_file}' not found.") # noqa: T201 return except OSError: # Handle other I/O errors - print(f"Error createResponseCSV.py: Error reading '{dakota_tab_file}'.") # noqa: T201 + print(f"Error createResponseCSV.py: Error reading '{dakota_tab_file}'.") # noqa: T201 return diff --git a/modules/performUQ/common/parallel_runner_mpi4py.py b/modules/performUQ/common/parallel_runner_mpi4py.py index 64bbb4a6d..bf8de20bc 100644 --- a/modules/performUQ/common/parallel_runner_mpi4py.py +++ b/modules/performUQ/common/parallel_runner_mpi4py.py @@ -1,6 +1,7 @@ from mpi4py import MPI # noqa: INP001, D100 from mpi4py.futures import MPIPoolExecutor + class ParallelRunnerMPI4PY: # noqa: D101 def __init__(self, run_type: str = 'runningRemote') -> None: self.run_type = run_type