From bb3388e26da92039075a736e3777043033992d99 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Tue, 26 Aug 2025 08:54:32 -0400 Subject: [PATCH 01/29] Add initial testing matrix --- .github/workflows/testing.yml | 96 +++++++++++++++++++++++++++++++---- 1 file changed, 87 insertions(+), 9 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 5f6dfe7e..0bfda23b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -15,18 +15,50 @@ env: CLAW: ${{ github.workspace }} jobs: - build: - runs-on: ubuntu-latest + tests: + name: > + ${{ matrix.os }} - py ${{ matrix.python-version }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false # Probably want to turn this off for a large matrix + matrix: + os: [ubuntu-latest] + python-version: [3.10, 3.12] + build: [debug, opt] + toolchain: + - {compiler: gcc, version: 14} + - {compiler: gcc, version: 15} + # - {compiler: intel, version: '2025.0'} + # - {compiler: intel-classic, version: '2021.10'} + # - {compiler: nvidia-hpc, version: '25.1'} # does not build python + # - {compiler: lfortran, version: '0.45.0'} # lfortran not yet supported + # - {compiler: flang, version: '20.1.0'} # flang not yet supported + # include: + # - os: ubuntu-latest + # python-version: 3.10 + # build: opt + # toolchain: {compiler: gcc, version: 14} + exclude: + - os: ubuntu-latest + toolchain: {compiler: gcc, version: 15} + - os: macos-latest + toolchain: {compiler: gcc, version: 14} + steps: - - name: Set up Python 3.10 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: - python-version: "3.10" - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install gfortran + python-version: ${{ matrix.python-version }} + + - name: Set up compilers + uses: fortran-lang/setup-fortran@v1 + id: setup-fortran + with: + compiler: ${{ matrix.toolchain.compiler }} + version: ${{ matrix.toolchain.version }} + - name: Install python dependencies + run: | python -m pip install --upgrade pip pip install 'numpy<2.0' pip install matplotlib #Some imports require matplotlib @@ -44,12 +76,49 @@ jobs: uses: actions/checkout@v4.1.5 with: path: pyclaw - + - name: Install clawpack run: | + if [ "${{ matrix.toolchain.compiler }}" = "gcc" ]; then + if [ "${{ matrix.build }}" = "debug" ]; then + export FFLAGS="-O0 -g -fcheck=all -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow -finit-real=nan -finit-integer=nan -Wall -Wunderflow -Wextra -Wconversion -Wuninitialized -Warray-bounds -Wshadow -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-but-set-variable" + export CFLAGS="" + elif [ "${{ matrix.build }}" = "opt" ]; then + export FFLAGS="-O1 -funroll-loops -finline-functions -ftree-vectorize -fstack-protector-strong -flto -march=native" + export CFLAGS="" + else + echo "Unknown build type: ${{ matrix.build }}" + exit 1 + fi + elif [ "${{ matrix.toolchain.compiler }}" = "intel" ] || [ "${{ matrix.toolchain.compiler }}" = "intel-classic" ]; then + if [ "${{ matrix.build }}" = "debug" ]; then + export FFLAGS="" + export CFLAGS="" + elif [ "${{ matrix.build }}" = "opt" ]; then + export FFLAGS="" + export CFLAGS="" + else + echo "Unknown build type: ${{ matrix.build }}" + exit 1 + else + echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" + exit 1 + fi + echo "Using `$FC --version`" + echo "FFLAGS: $FFLAGS" + echo "CFLAGS: $CFLAGS" cd ${CLAW} pip install --no-build-isolation --editable . + - name: Lint with flake8 + if: ${{ matrix.build == 'debug' }} + run: | + cd ${CLAW}/pyclaw + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude dev + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest run: | cd ${CLAW}/pyclaw @@ -64,3 +133,12 @@ jobs: env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: test_results + # Currently this does not save anything + path: ${{ env.CLAW }}/pyclaw/*_output + if-no-files-found: ignore From 38ef2aec77d8ff9056e9f76fed0861bedfd1f55b Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Tue, 26 Aug 2025 09:01:35 -0400 Subject: [PATCH 02/29] Fix bugs in testing script --- .github/workflows/testing.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0bfda23b..df93964b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest] - python-version: [3.10, 3.12] + python-version: ["3.10", "3.12"] build: [debug, opt] toolchain: - {compiler: gcc, version: 14} @@ -100,6 +100,7 @@ jobs: else echo "Unknown build type: ${{ matrix.build }}" exit 1 + fi else echo "Unknown compiler: ${{ matrix.toolchain.compiler }}" exit 1 From d9ce97a733044e05de9355611527544c2361c588 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Tue, 26 Aug 2025 09:11:05 -0400 Subject: [PATCH 03/29] Add macos to testing --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index df93964b..26d80562 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false # Probably want to turn this off for a large matrix matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, macos-latest] python-version: ["3.10", "3.12"] build: [debug, opt] toolchain: From 3f7766c146d2079c0da17009c3570c47bfcfbddd Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Tue, 26 Aug 2025 09:20:20 -0400 Subject: [PATCH 04/29] Cleanup some source that was failing via pyflake --- cleanup_examples.py | 18 ++++++++--------- examples/compare_solvers.py | 6 +++--- fvmbook/chap22/inclusion/inclusion.py | 29 +++++++++++++-------------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/cleanup_examples.py b/cleanup_examples.py index 483a592f..d9627d89 100755 --- a/cleanup_examples.py +++ b/cleanup_examples.py @@ -4,16 +4,17 @@ Cleans up by deleting object files, executable, and _output directory. """ -import os,sys,glob +import os +import sys import shutil if __name__ == "__main__": examples_dir = os.path.abspath('./examples') - print "Will remove all _output, _plots, and build directories from ",examples_dir - ans = raw_input("Ok? ") + print(f"Will remove all _output, _plots, and build directories from {examples_dir}") + ans = input("Ok? ") if ans.lower() not in ['y','yes']: - print "Aborting." + print("Aborting.") sys.exit() os.chdir(examples_dir) @@ -21,15 +22,14 @@ for (dirpath, subdirs, files) in os.walk('.'): currentdir = os.path.abspath(os.getcwd()) os.chdir(os.path.abspath(dirpath)) - - print 'In directory ',dirpath - + + print(f'In directory {dirpath}') + if os.path.isdir('_output'): shutil.rmtree('./_output') if os.path.isdir('_plots'): shutil.rmtree('./_plots') if os.path.isdir('build'): shutil.rmtree('./build') - - os.chdir(currentdir) + os.chdir(currentdir) diff --git a/examples/compare_solvers.py b/examples/compare_solvers.py index de0902b1..1d40d761 100755 --- a/examples/compare_solvers.py +++ b/examples/compare_solvers.py @@ -160,12 +160,12 @@ def compare_2D(nx=(250,250)): import sys vis = True - + if vis: compare_solvers.outdir='./_output' else: compare_solvers.outdir = None - + if len(sys.argv) > 1: nx_1D = int(sys.argv[1]) else: @@ -173,7 +173,7 @@ def compare_2D(nx=(250,250)): if len(sys.argv) > 2: # '(2,2)' -> (2,2) - nx_2D = tuple(int(i) for i in argv.split(',')) + nx_2D = tuple(int(i) for i in sys.argv.split(',')) else: nx_2D = 100,100 diff --git a/fvmbook/chap22/inclusion/inclusion.py b/fvmbook/chap22/inclusion/inclusion.py index bb3489be..0777bd1b 100644 --- a/fvmbook/chap22/inclusion/inclusion.py +++ b/fvmbook/chap22/inclusion/inclusion.py @@ -4,7 +4,7 @@ Variable-coefficient elasticity example. """ import numpy as np -from six.moves import range + t0wall = 0.025 tperiod = 0.05 @@ -13,7 +13,7 @@ def moving_wall_bc(state,dim,t,qbc,auxbc,num_ghost): if t Date: Tue, 26 Aug 2025 09:31:55 -0400 Subject: [PATCH 05/29] Tweak flake8 call --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 26d80562..b59a973e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.10", "3.12"] + python-version: ["3.8", "3.12"] build: [debug, opt] toolchain: - {compiler: gcc, version: 14} @@ -116,7 +116,7 @@ jobs: run: | cd ${CLAW}/pyclaw # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude dev + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude "development","src/pyclaw/fileio/netcdf.py" # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics From 6dbc5c4b2fc46f72f74477f67edf7a3f7fb2890a Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Tue, 26 Aug 2025 09:41:39 -0400 Subject: [PATCH 06/29] Limit build options and python versions to see if the testing can pass again --- .github/workflows/testing.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b59a973e..eca9bc7e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest, macos-latest] - python-version: ["3.8", "3.12"] + python-version: ["3.12"] build: [debug, opt] toolchain: - {compiler: gcc, version: 14} @@ -84,7 +84,8 @@ jobs: export FFLAGS="-O0 -g -fcheck=all -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow -finit-real=nan -finit-integer=nan -Wall -Wunderflow -Wextra -Wconversion -Wuninitialized -Warray-bounds -Wshadow -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-but-set-variable" export CFLAGS="" elif [ "${{ matrix.build }}" = "opt" ]; then - export FFLAGS="-O1 -funroll-loops -finline-functions -ftree-vectorize -fstack-protector-strong -flto -march=native" + # export FFLAGS="-O1 -funroll-loops -finline-functions -ftree-vectorize -fstack-protector-strong -flto -march=native" + export FFLAGS="" export CFLAGS="" else echo "Unknown build type: ${{ matrix.build }}" From 449197ead520ca0abc6ff79a83ceb27c468bf820 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Tue, 26 Aug 2025 09:48:27 -0400 Subject: [PATCH 07/29] Try using current numpy --- .github/workflows/testing.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index eca9bc7e..280be50c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -60,7 +60,8 @@ jobs: - name: Install python dependencies run: | python -m pip install --upgrade pip - pip install 'numpy<2.0' + # pip install 'numpy<2.0' + pip install numpy pip install matplotlib #Some imports require matplotlib pip install scipy #To not skip tests pip install flake8 meson-python ninja pytest coveralls From de9baa170b0a21d03244ef254ef4934c1635249d Mon Sep 17 00:00:00 2001 From: David Ketcheson Date: Wed, 3 Sep 2025 07:03:58 +0300 Subject: [PATCH 08/29] Verbose pytest output. --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 280be50c..c1351d99 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -125,7 +125,7 @@ jobs: - name: Test with pytest run: | cd ${CLAW}/pyclaw - coverage run --source=src -m pytest --ignore=development -k "not test_shallow_sphere" + coverage run --source=src -m pytest -vv --showlocals --ignore=development -k "not test_shallow_sphere" - name: Upload to Coveralls if: always() From 9bcbb123eaa94c5c3839a2ac5f2c4a4039d35c99 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 10:05:39 -0400 Subject: [PATCH 09/29] Add test summary action --- .github/workflows/testing.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c1351d99..e8665494 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -125,7 +125,15 @@ jobs: - name: Test with pytest run: | cd ${CLAW}/pyclaw - coverage run --source=src -m pytest -vv --showlocals --ignore=development -k "not test_shallow_sphere" + coverage run --source=src -m pytest -vv --showlocals --ignore=development -k "not test_shallow_sphere" --junitxml=test-results.xml + + - name: Process test results + uses: test-summary/action@v2.4 + if: always() + with: + paths: .test_report.xml + output: test-summary.md + show: all - name: Upload to Coveralls if: always() From 8788601d84366472281f356e1cc9ea03d76eb843 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 10:12:33 -0400 Subject: [PATCH 10/29] Restrict coverage uploading to one config --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e8665494..442e2507 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -136,7 +136,7 @@ jobs: show: all - name: Upload to Coveralls - if: always() + if: ${ matrix.os == 'ubuntu-latest' matrix.toolchain.compiler == 'gcc' && matrix.build == 'opt' && python-version == '3.12' } run: | cd ${CLAW}/pyclaw ls -l .coverage From 9912138f2b5985cbb82de55b7c5680e58a382342 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 10:12:55 -0400 Subject: [PATCH 11/29] Fix errant . --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 442e2507..39e73ff3 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -131,7 +131,7 @@ jobs: uses: test-summary/action@v2.4 if: always() with: - paths: .test_report.xml + paths: test_report.xml output: test-summary.md show: all From b91bce4d563d02d91dcd10240f8e58dc6d4c30a4 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 10:16:30 -0400 Subject: [PATCH 12/29] Correct some github action syntax bugs --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 39e73ff3..8298b08b 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -136,7 +136,7 @@ jobs: show: all - name: Upload to Coveralls - if: ${ matrix.os == 'ubuntu-latest' matrix.toolchain.compiler == 'gcc' && matrix.build == 'opt' && python-version == '3.12' } + if: ${{ matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'gcc' && matrix.build == 'opt' && matrix.python-version == '3.12' }} run: | cd ${CLAW}/pyclaw ls -l .coverage From 306968340cf0ccde173d5e1f68d5be9223555a1e Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 10:23:56 -0400 Subject: [PATCH 13/29] Correct missing path info --- .github/workflows/testing.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8298b08b..25d9a939 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -110,13 +110,13 @@ jobs: echo "Using `$FC --version`" echo "FFLAGS: $FFLAGS" echo "CFLAGS: $CFLAGS" - cd ${CLAW} + cd ${{ env.CLAW }} pip install --no-build-isolation --editable . - name: Lint with flake8 if: ${{ matrix.build == 'debug' }} run: | - cd ${CLAW}/pyclaw + cd ${{ env.CLAW }} # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude "development","src/pyclaw/fileio/netcdf.py" # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide @@ -124,21 +124,21 @@ jobs: - name: Test with pytest run: | - cd ${CLAW}/pyclaw + cd ${{ env.CLAW }} coverage run --source=src -m pytest -vv --showlocals --ignore=development -k "not test_shallow_sphere" --junitxml=test-results.xml - name: Process test results uses: test-summary/action@v2.4 if: always() with: - paths: test_report.xml + paths: ${{ env.CLAW }}/pyclaw/test_report.xml output: test-summary.md show: all - name: Upload to Coveralls if: ${{ matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'gcc' && matrix.build == 'opt' && matrix.python-version == '3.12' }} run: | - cd ${CLAW}/pyclaw + cd ${{ env.CLAW }}/pyclaw ls -l .coverage coveralls env: @@ -146,10 +146,10 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload test results - if: failure() + # if: failure() + if: always() uses: actions/upload-artifact@v4 with: name: test_results - # Currently this does not save anything - path: ${{ env.CLAW }}/pyclaw/*_output + path: ${{ env.CLAW }}/pyclaw/test-summary.md if-no-files-found: ignore From 33307b4df0dbd7f2411a3eecbd6ee7ed902bba4c Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 10:30:14 -0400 Subject: [PATCH 14/29] Fix bad path/naming again --- .github/workflows/testing.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 25d9a939..cedce054 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -20,7 +20,7 @@ jobs: ${{ matrix.os }} - py ${{ matrix.python-version }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} runs-on: ${{ matrix.os }} strategy: - fail-fast: false # Probably want to turn this off for a large matrix + fail-fast: true # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest, macos-latest] python-version: ["3.12"] @@ -125,7 +125,7 @@ jobs: - name: Test with pytest run: | cd ${{ env.CLAW }} - coverage run --source=src -m pytest -vv --showlocals --ignore=development -k "not test_shallow_sphere" --junitxml=test-results.xml + coverage run --source=src -m pytest -vv --showlocals --ignore=development -k "not test_shallow_sphere" --junitxml=test-report.xml - name: Process test results uses: test-summary/action@v2.4 @@ -135,6 +135,15 @@ jobs: output: test-summary.md show: all + - name: Upload test results + # if: failure() + if: always() + uses: actions/upload-artifact@v4 + with: + name: test_results + path: ${{ env.CLAW }}/pyclaw/test-summary.md + if-no-files-found: ignore + - name: Upload to Coveralls if: ${{ matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'gcc' && matrix.build == 'opt' && matrix.python-version == '3.12' }} run: | @@ -144,12 +153,3 @@ jobs: env: COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload test results - # if: failure() - if: always() - uses: actions/upload-artifact@v4 - with: - name: test_results - path: ${{ env.CLAW }}/pyclaw/test-summary.md - if-no-files-found: ignore From 9650824a526c98e27d7554726b30d1d84bdb11a8 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 10:37:30 -0400 Subject: [PATCH 15/29] Fix another path problem --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index cedce054..0b54c9c7 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -124,7 +124,7 @@ jobs: - name: Test with pytest run: | - cd ${{ env.CLAW }} + cd ${{ env.CLAW }}/pyclaw coverage run --source=src -m pytest -vv --showlocals --ignore=development -k "not test_shallow_sphere" --junitxml=test-report.xml - name: Process test results From 6506f858658c8273c7fa94ca829c0992647e3a2e Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 10:45:15 -0400 Subject: [PATCH 16/29] Try confusing pathing fix --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0b54c9c7..29e0e1c5 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -131,7 +131,7 @@ jobs: uses: test-summary/action@v2.4 if: always() with: - paths: ${{ env.CLAW }}/pyclaw/test_report.xml + paths: ${{ env.CLAW }}/test_report.xml output: test-summary.md show: all @@ -141,7 +141,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: test_results - path: ${{ env.CLAW }}/pyclaw/test-summary.md + path: ${{ env.CLAW }}/test-summary.md if-no-files-found: ignore - name: Upload to Coveralls From f6c82efa067ba2877910e30cf5b82f5dc4f87b33 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 10:58:52 -0400 Subject: [PATCH 17/29] Fix linting path --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 29e0e1c5..8fdfac14 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -116,7 +116,7 @@ jobs: - name: Lint with flake8 if: ${{ matrix.build == 'debug' }} run: | - cd ${{ env.CLAW }} + cd ${{ env.CLAW }}/pyclaw # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude "development","src/pyclaw/fileio/netcdf.py" # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide From bf6b195b1384d2522757e8f8a99da420f8fb17d9 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 11:35:49 -0400 Subject: [PATCH 18/29] One more try at getting pathing right --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 8fdfac14..9a0ee2c3 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -131,7 +131,7 @@ jobs: uses: test-summary/action@v2.4 if: always() with: - paths: ${{ env.CLAW }}/test_report.xml + paths: ${{ env.CLAW }}/pyclaw/test_report.xml output: test-summary.md show: all @@ -141,7 +141,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: test_results - path: ${{ env.CLAW }}/test-summary.md + path: ${{ env.CLAW }}/pyclaw/test-summary.md if-no-files-found: ignore - name: Upload to Coveralls From 1d3feaec918abb2c2fa2b5c92d0d7b5eb5b54037 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 11:43:53 -0400 Subject: [PATCH 19/29] This is on me, clearly I cannot deal with paths --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 9a0ee2c3..b4fa4a2c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -131,7 +131,7 @@ jobs: uses: test-summary/action@v2.4 if: always() with: - paths: ${{ env.CLAW }}/pyclaw/test_report.xml + paths: ${{ env.CLAW }}/pyclaw/test-report.xml output: test-summary.md show: all From 42a61ca3c6b6f31e1d072c686fac22209a19145f Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 12:09:05 -0400 Subject: [PATCH 20/29] Turn off fast fail --- .github/workflows/testing.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index b4fa4a2c..ce5c6612 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -20,7 +20,7 @@ jobs: ${{ matrix.os }} - py ${{ matrix.python-version }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} runs-on: ${{ matrix.os }} strategy: - fail-fast: true # Probably want to turn this off for a large matrix + fail-fast: false # Probably want to turn this off for a large matrix matrix: os: [ubuntu-latest, macos-latest] python-version: ["3.12"] @@ -133,7 +133,7 @@ jobs: with: paths: ${{ env.CLAW }}/pyclaw/test-report.xml output: test-summary.md - show: all + show: "all" - name: Upload test results # if: failure() From dbc8e26beda7d6505763c72033928a33ca21a7f6 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 12:55:05 -0400 Subject: [PATCH 21/29] Adjust archive source file path --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index ce5c6612..df53cd47 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -132,7 +132,7 @@ jobs: if: always() with: paths: ${{ env.CLAW }}/pyclaw/test-report.xml - output: test-summary.md + output: ${{ env.CLAW }}/pyclaw/test-summary.md show: "all" - name: Upload test results From a16fcb8f34ac98248b220bee3db16ebbbeec030b Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 13:04:25 -0400 Subject: [PATCH 22/29] Uniquely identify test results --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index df53cd47..0f817480 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -140,7 +140,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: test_results + name: ${{ matrix.os }}-py${{ matrix.python-version }}-{{ matrix.toolchain.compiler }}-{{ matrix.build }} path: ${{ env.CLAW }}/pyclaw/test-summary.md if-no-files-found: ignore From a60230c2075adfe867547273e36d576690078109 Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Thu, 4 Sep 2025 15:09:50 -0400 Subject: [PATCH 23/29] Fix missing variable declarations in archiving step --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0f817480..3ec07532 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -140,7 +140,7 @@ jobs: if: always() uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os }}-py${{ matrix.python-version }}-{{ matrix.toolchain.compiler }}-{{ matrix.build }} + name: ${{ matrix.os }}-py${{ matrix.python-version }}-${{ matrix.toolchain.compiler }}-${{ matrix.build }} path: ${{ env.CLAW }}/pyclaw/test-summary.md if-no-files-found: ignore From d30fdcb2e489a4e7fbd0c54840d58c06ad0da8ba Mon Sep 17 00:00:00 2001 From: Kyle Mandli Date: Fri, 5 Sep 2025 10:09:19 -0400 Subject: [PATCH 24/29] Do not capture output in pytest --- .github/workflows/testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3ec07532..b33b4ae2 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -125,7 +125,7 @@ jobs: - name: Test with pytest run: | cd ${{ env.CLAW }}/pyclaw - coverage run --source=src -m pytest -vv --showlocals --ignore=development -k "not test_shallow_sphere" --junitxml=test-report.xml + coverage run --source=src -m pytest -vv -s --showlocals --ignore=development -k "not test_shallow_sphere" --junitxml=test-report.xml - name: Process test results uses: test-summary/action@v2.4 From ffc2ece1aa53eddaf3a948ceb8c0111cdaad35c3 Mon Sep 17 00:00:00 2001 From: David Ketcheson Date: Mon, 6 Oct 2025 12:25:45 -0700 Subject: [PATCH 25/29] Update the expected dimension of limiters array. For sharpclaw, this is sometimes num_eqn and sometimes num_waves depending on options. --- src/pyclaw/sharpclaw/solver.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pyclaw/sharpclaw/solver.py b/src/pyclaw/sharpclaw/solver.py index 77865ccb..f0553572 100644 --- a/src/pyclaw/sharpclaw/solver.py +++ b/src/pyclaw/sharpclaw/solver.py @@ -518,10 +518,16 @@ def check_3rd_ord_cond(self,state,step_index,dtFE): def _set_mthlim(self): self._mthlim = self.limiters - if not isinstance(self.limiters,list): self._mthlim=[self._mthlim] - if len(self._mthlim)==1: self._mthlim = self._mthlim * self.num_waves - if len(self._mthlim)!=self.num_waves: - raise Exception('Length of solver.limiters is not equal to 1 or to solver.num_waves') + if self.char_decomp == 0: # entry-wise limiting + if len(self._mthlim)==1: self._mthlim = self._mthlim * self.num_eqn + if not isinstance(self.limiters,list): self._mthlim=[self._mthlim] + if len(self._mthlim)!=self.num_eqn: + raise Exception('Length of solver.limiters is not equal to 1 or to solver.num_eqn') + else: # Wave-wise limiting + if len(self._mthlim)==1: self._mthlim = self._mthlim * self.num_waves + if not isinstance(self.limiters,list): self._mthlim=[self._mthlim] + if len(self._mthlim)!=self.num_waves: + raise Exception('Length of solver.limiters is not equal to 1 or to solver.num_waves') def dq(self,state): From ed97c6d483e5aa03bbfcc4733be5aea91dcf6234 Mon Sep 17 00:00:00 2001 From: David Ketcheson Date: Mon, 6 Oct 2025 12:38:05 -0700 Subject: [PATCH 26/29] Make sure limiters is a list. --- src/pyclaw/sharpclaw/solver.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pyclaw/sharpclaw/solver.py b/src/pyclaw/sharpclaw/solver.py index f0553572..2961f807 100644 --- a/src/pyclaw/sharpclaw/solver.py +++ b/src/pyclaw/sharpclaw/solver.py @@ -518,6 +518,7 @@ def check_3rd_ord_cond(self,state,step_index,dtFE): def _set_mthlim(self): self._mthlim = self.limiters + if not isinstance(self.limiters,list): self._mthlim=[self._mthlim] if self.char_decomp == 0: # entry-wise limiting if len(self._mthlim)==1: self._mthlim = self._mthlim * self.num_eqn if not isinstance(self.limiters,list): self._mthlim=[self._mthlim] From 92b956ce9a49ad274c25d72874f5997d4d6cbf98 Mon Sep 17 00:00:00 2001 From: David Ketcheson Date: Mon, 6 Oct 2025 12:50:52 -0700 Subject: [PATCH 27/29] Fix stupid bug I just introduced. --- src/pyclaw/sharpclaw/solver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pyclaw/sharpclaw/solver.py b/src/pyclaw/sharpclaw/solver.py index 2961f807..644c141e 100644 --- a/src/pyclaw/sharpclaw/solver.py +++ b/src/pyclaw/sharpclaw/solver.py @@ -519,14 +519,14 @@ def check_3rd_ord_cond(self,state,step_index,dtFE): def _set_mthlim(self): self._mthlim = self.limiters if not isinstance(self.limiters,list): self._mthlim=[self._mthlim] + print(len(self._mthlim), self._mthlim) if self.char_decomp == 0: # entry-wise limiting if len(self._mthlim)==1: self._mthlim = self._mthlim * self.num_eqn - if not isinstance(self.limiters,list): self._mthlim=[self._mthlim] + print(len(self._mthlim), self._mthlim) if len(self._mthlim)!=self.num_eqn: raise Exception('Length of solver.limiters is not equal to 1 or to solver.num_eqn') else: # Wave-wise limiting if len(self._mthlim)==1: self._mthlim = self._mthlim * self.num_waves - if not isinstance(self.limiters,list): self._mthlim=[self._mthlim] if len(self._mthlim)!=self.num_waves: raise Exception('Length of solver.limiters is not equal to 1 or to solver.num_waves') From 0fefb498cfb9337eb44832f9d17d0dcd4a036124 Mon Sep 17 00:00:00 2001 From: David Ketcheson Date: Mon, 6 Oct 2025 12:59:54 -0700 Subject: [PATCH 28/29] Avoid explicitly indexing into empty aux array. --- src/pyclaw/classic/flux3.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyclaw/classic/flux3.f90 b/src/pyclaw/classic/flux3.f90 index ac3f316f..545dea34 100644 --- a/src/pyclaw/classic/flux3.f90 +++ b/src/pyclaw/classic/flux3.f90 @@ -199,7 +199,7 @@ subroutine flux3(ixyz,maxm,num_eqn,num_waves,num_ghost,mx, & ! aux2(1-num_ghost,1,2) is the start of a 1d array now used by rpn3 call rpn3(ixyz,maxm,num_eqn,num_waves,num_aux,num_ghost,mx,q1d,q1d, & - aux2(1,1-num_ghost,2),aux2(1,1-num_ghost,2),wave,s,amdq,apdq) + aux2(:,1-num_ghost,2),aux2(:,1-num_ghost,2),wave,s,amdq,apdq) ! Set qadd for the donor-cell upwind method (Godunov) forall (m = 1:num_eqn, i = 1:mx+1) From 86c212b9a69e23135a2139319e24d3dff7634b4c Mon Sep 17 00:00:00 2001 From: David Ketcheson Date: Mon, 6 Oct 2025 16:49:31 -0700 Subject: [PATCH 29/29] Remove debugging print statements. --- src/pyclaw/sharpclaw/solver.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pyclaw/sharpclaw/solver.py b/src/pyclaw/sharpclaw/solver.py index 644c141e..7f991e6d 100644 --- a/src/pyclaw/sharpclaw/solver.py +++ b/src/pyclaw/sharpclaw/solver.py @@ -519,10 +519,8 @@ def check_3rd_ord_cond(self,state,step_index,dtFE): def _set_mthlim(self): self._mthlim = self.limiters if not isinstance(self.limiters,list): self._mthlim=[self._mthlim] - print(len(self._mthlim), self._mthlim) if self.char_decomp == 0: # entry-wise limiting if len(self._mthlim)==1: self._mthlim = self._mthlim * self.num_eqn - print(len(self._mthlim), self._mthlim) if len(self._mthlim)!=self.num_eqn: raise Exception('Length of solver.limiters is not equal to 1 or to solver.num_eqn') else: # Wave-wise limiting