From e81a17ffed3935e0a7164433e8e9e5eaaf261cad Mon Sep 17 00:00:00 2001 From: Carlos Munoz Moncayo Date: Wed, 7 Aug 2024 16:45:48 +0300 Subject: [PATCH 1/3] Do not compile RS from test and increase error tol --- examples/euler_gravity_3d/test_eulerg3d.py | 5 +---- examples/shallow_2d/test_shallow2d.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/euler_gravity_3d/test_eulerg3d.py b/examples/euler_gravity_3d/test_eulerg3d.py index c30d37b5..7fe64ebd 100644 --- a/examples/euler_gravity_3d/test_eulerg3d.py +++ b/examples/euler_gravity_3d/test_eulerg3d.py @@ -9,15 +9,12 @@ class TestEulerGravity3D: def test_rising_hot_sphere(self): _ = importorskip("scipy") # skip test if scipy is not installed - #Compile source - command = ["make", "all"] - subprocess.call(command,cwd=thisdir) # Read expected solution expected_density = np.loadtxt(os.path.join(thisdir,'verify_rising_hot_sphere_classic_1.txt')) #Run test - import rising_hot_sphere + from . import rising_hot_sphere claw = rising_hot_sphere.euler3d(kernel_language='Fortran',solver_type='classic', disable_output=True,mx=80, my=80, mz=80, tfinal=1.0, num_output_times=1) claw.run() diff --git a/examples/shallow_2d/test_shallow2d.py b/examples/shallow_2d/test_shallow2d.py index fb361fc6..38c0c9e2 100644 --- a/examples/shallow_2d/test_shallow2d.py +++ b/examples/shallow_2d/test_shallow2d.py @@ -30,7 +30,7 @@ def test_radialdambreak(self): for riemann_solver in riemann_solvers: test_name = f'radialdambreak_{solver_type}_{riemann_solver}' assert error(test_name=test_name, solver_type=solver_type, - riemann_solver=riemann_solver, disable_output=True)<1e-6, f"Test {test_name} failed" + riemann_solver=riemann_solver, disable_output=True)<1e-5, f"Test {test_name} failed" def test_sill(self): assert error(test_name="sill", outdir=None)<1e-6, f"Test sill failed" From e04800bafe04a34b17081addb2d7327d24ac1c3a Mon Sep 17 00:00:00 2001 From: Carlos Munoz Moncayo Date: Wed, 7 Aug 2024 17:21:23 +0300 Subject: [PATCH 2/3] Add GH CI testing workflow --- .github/workflows/testing.yml | 61 +++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/testing.yml diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 00000000..ace3aeaa --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,61 @@ +name: Test PyClaw + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + + 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 + # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Checkout Clawpack + uses: actions/checkout@v4.1.5 + with: + repository: clawpack/clawpack + submodules: true + + - name: Checkout PyClaw branch + uses: actions/checkout@v4.1.5 + with: + path: pyclaw + + - name: Checkout Riemann branch + uses: actions/checkout@v4.1.5 + with: + path: riemann + + - name: Install clawpack + run: | + cd ${CLAW} + pip install --no-build-isolation --editable . + + - name: Test with pytest + run: | + cd ${CLAW}/pyclaw + pytest --ignore=development From 78f0b6309cd116ff16b0aeb0826ead5bbedcb293 Mon Sep 17 00:00:00 2001 From: Carlos Munoz Moncayo Date: Wed, 7 Aug 2024 18:14:48 +0300 Subject: [PATCH 3/3] Just checkout PyClaw branch --- .github/workflows/testing.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index ace3aeaa..c8df5db0 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -45,11 +45,6 @@ jobs: with: path: pyclaw - - name: Checkout Riemann branch - uses: actions/checkout@v4.1.5 - with: - path: riemann - - name: Install clawpack run: | cd ${CLAW}