-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and improve Riemann solver code (#176)
* Start using implicit none in all Riemann solvers. * Start using implicit none in all Riemann solvers. * Add a temporary testing workflow It uses PyClaw's tests since, to my understanding, an ensemble of local regression tests for the Riemann repository using Pytest would require the appropriate argument intents of the rp* subroutines to be explicitly declared already. So the Riemann solvers should be modernized first. Also, the test for shallow water on the sphere is omitted for the moment. * Fix typo branch name * Use implicit none in more Riemann solvers * implicit none in SWEs on the sphere The PyClaw test that uses this RS is skipped in the testing workflow since it leads to a core dump (I suspect this has to do with the OS or the system architecture). However, this test passes locally for me (before and after the implicit none changes). * All 2D RSs using implicit none * implicit none used in every Riemann solver * Add workflow for Classic tests * Temporary fix Pytest not collecting AMRClaw tests The regression tests in AMRClaw are not being collected by Pytest. They just have to be renamed. This is a temporary fix to run them from this repo in a single pytest session. --------- Co-authored-by: Carlos Munoz Moncayo <[email protected]>
- Loading branch information
1 parent
95a03ca
commit 8d62870
Showing
43 changed files
with
942 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Test Riemann solvers with AMRClaw tests | ||
|
||
on: | ||
push: | ||
branches: [ "implicit_none" ] | ||
pull_request: | ||
branches: [ "implicit_none" ] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
CLAW: ${{ github.workspace }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gfortran | ||
python -m pip install --upgrade pip | ||
pip install 'numpy<2.0' | ||
pip install matplotlib #Some imports require matplotlib | ||
pip install scipy #To not skip tests | ||
pip install nose | ||
pip install flake8 meson-python ninja pytest | ||
- name: Checkout Clawpack | ||
uses: actions/[email protected] | ||
with: | ||
repository: clawpack/clawpack | ||
submodules: true | ||
|
||
- name: Checkout AMRClaw branch | ||
uses: actions/[email protected] | ||
with: | ||
repository: clawpack/amrclaw # | ||
path: amrclaw | ||
ref: master | ||
|
||
- name: Checkout implicit_none from this repo | ||
uses: actions/[email protected] | ||
with: | ||
repository: ${{ github.repository }} | ||
path: ${{ env.CLAW }}/riemann | ||
ref: implicit_none | ||
|
||
- name: Install Clawpack | ||
run: | | ||
cd ${CLAW} | ||
pip install --no-build-isolation --editable . | ||
- name: Test with pytest | ||
run: | | ||
cd ${CLAW}/riemann | ||
bash collect_pytests_amrclaw.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Test Riemann solvers with Classic Clawpack tests | ||
|
||
on: | ||
push: | ||
branches: [ "implicit_none" ] | ||
pull_request: | ||
branches: [ "implicit_none" ] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
CLAW: ${{ github.workspace }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gfortran | ||
python -m pip install --upgrade pip | ||
pip install 'numpy<2.0' | ||
pip install matplotlib #Some imports require matplotlib | ||
pip install scipy #To not skip tests | ||
pip install nose | ||
pip install flake8 meson-python ninja pytest | ||
- name: Checkout Clawpack | ||
uses: actions/[email protected] | ||
with: | ||
repository: clawpack/clawpack | ||
submodules: true | ||
|
||
- name: Checkout Classic branch | ||
uses: actions/[email protected] | ||
with: | ||
repository: clawpack/classic # | ||
path: classic | ||
ref: master | ||
|
||
- name: Checkout implicit_none from this repo | ||
uses: actions/[email protected] | ||
with: | ||
repository: ${{ github.repository }} | ||
path: ${{ env.CLAW }}/riemann | ||
ref: implicit_none | ||
|
||
- name: Install Clawpack | ||
run: | | ||
cd ${CLAW} | ||
pip install --no-build-isolation --editable . | ||
- name: Test with pytest | ||
run: | | ||
cd ${CLAW}/classic | ||
pytest tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Test Riemann solvers with PyClaw tests | ||
|
||
on: | ||
push: | ||
branches: [ "implicit_none" ] | ||
pull_request: | ||
branches: [ "implicit_none" ] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
CLAW: ${{ github.workspace }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gfortran | ||
python -m pip install --upgrade pip | ||
pip install 'numpy<2.0' | ||
pip install matplotlib #Some imports require matplotlib | ||
pip install scipy #To not skip tests | ||
pip install flake8 meson-python ninja pytest | ||
- name: Checkout Clawpack | ||
uses: actions/[email protected] | ||
with: | ||
repository: clawpack/clawpack | ||
submodules: true | ||
|
||
- name: Checkout PyClaw branch | ||
uses: actions/[email protected] | ||
with: | ||
repository: clawpack/pyclaw # | ||
path: pyclaw | ||
ref: master | ||
|
||
- name: Checkout implicit_none from this repo | ||
uses: actions/[email protected] | ||
with: | ||
repository: ${{ github.repository }} | ||
path: ${{ env.CLAW }}/riemann | ||
ref: implicit_none | ||
|
||
- name: Install Clawpack | ||
run: | | ||
cd ${CLAW} | ||
pip install --no-build-isolation --editable . | ||
- name: Test with pytest | ||
run: | | ||
cd ${CLAW}/pyclaw | ||
pytest --ignore=development --ignore=examples/shallow_sphere |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#Collect Pytest tests for AMRClaw | ||
cd ${CLAW}/amrclaw/tests | ||
pathlist=() | ||
for dir in $(ls -d */); do | ||
cd $dir | ||
#Check if there are any test files | ||
#Capture the error message and check if it is empty | ||
if [ -z "$(ls *test*.py 2>/dev/null )" ]; then | ||
cd .. | ||
continue | ||
fi | ||
for file in $(ls *test*.py); do | ||
pathlist+=($(pwd)/$file) | ||
done | ||
cd .. | ||
done | ||
|
||
#Run the tests | ||
pytest ${pathlist[@]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.