Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Try to reinstate #93

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/deploy-jupyter-book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install --user git+https://github.com/devitocodes/devito.git

# Build the book
- name: Build the book
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/jupyter-notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
DEVITO_LANGUAGE: ${{ matrix.language }}
DEVITO_BACKEND: "core"
PYTHON_VERSION: "3.9"
RUN_CMD: ""

strategy:
# Prevent all build to stop if a single one fails
Expand Down Expand Up @@ -61,32 +60,29 @@ jobs:
run: |
if [ "${{ matrix.compiler }}" = "gcc-9" ]; then
brew install gcc
else
sudo xcode-select -s /Applications/Xcode_11.app/Contents/Developer
fi
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install matplotlib
pip install --user git+https://github.com/devitocodes/devito.git
- name: Vibration ODE notebooks (1.1 to 1.8)
run: |
$RUN_CMD python -m pytest -W ignore::DeprecationWarning --nbval --cov . --cov-config=.coveragerc --cov-report=xml:vib_coverage.xml $SKIP fdm-devito-notebooks/01_vib/vib_undamped.ipynb
- name: Waves notebooks (2.1 and 2.2)
python -m py.test --nbval --cov . --cov-config=.coveragerc --cov-report=xml:vib_coverage.xml fdm-devito-notebooks/01_vib/vib_undamped.ipynb
- name: Waves notebooks (2.1 and 2.2)
run: |
$RUN_CMD python -m pytest -W ignore::DeprecationWarning --nbval --cov . --cov-config=.coveragerc --cov-report=xml:waves_coverage.xml $SKIP fdm-devito-notebooks/02_wave/wave1D_fd1.ipynb
python -m py.test --nbval --cov . --cov-config=.coveragerc --cov-report=xml:waves_coverage.xml fdm-devito-notebooks/02_wave/wave1D_fd1.ipynb
- name: Waves notebooks (2.3 to 2.5)
run: |
$RUN_CMD python -m pytest -W ignore::DeprecationWarning --nbval --cov . --cov-config=.coveragerc --cov-report=xml:waves_coverage.xml $SKIP fdm-devito-notebooks/02_wave/wave1D_prog.ipynb
python -m py.test --nbval --cov . --cov-config=.coveragerc --cov-report=xml:waves_coverage.xml fdm-devito-notebooks/02_wave/wave1D_prog.ipynb
- name: Diffusion notebooks (3.7)
run: |
$RUN_CMD python -m pytest -W ignore::DeprecationWarning --nbval --cov . --cov-config=.coveragerc --cov-report=xml:diffu_coverage.xml $SKIP fdm-devito-notebooks/03_diffu/diffu_rw.ipynb
python -m pytest --nbval --cov . --cov-config=.coveragerc --cov-report=xml:diffu_coverage.xml fdm-devito-notebooks/03_diffu/diffu_rw.ipynb
- name: Advection notebook (4)
run: |
$RUN_CMD python -m pytest -W ignore::DeprecationWarning --nbval --cov . --cov-config=.coveragerc --cov-report=xml:advec_coverage.xml $SKIP fdm-devito-notebooks/04_advec/advec.ipynb
python -m pytest --nbval --cov . --cov-config=.coveragerc --cov-report=xml:advec_coverage.xml fdm-devito-notebooks/04_advec/advec.ipynb
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.6
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.name }}
Expand Down
36 changes: 16 additions & 20 deletions .github/workflows/verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,40 @@ jobs:
DEVITO_ARCH: "${{ matrix.compiler }}"
DEVITO_LANGUAGE: ${{ matrix.language }}
DEVITO_BACKEND: "core"
PYTHON_VERSION: "3.7"
RUN_CMD: ""
PYTHON_VERSION: "3.9"

strategy:
# Prevent all build to stop if a single one fails
fail-fast: false
matrix:
name: [tutos-ubuntu-gcc-py37,
tutos-osx-gcc-py37,
tutos-osx-clang-py37]
name: [tutos-ubuntu-gcc-py39,
tutos-osx-gcc-py39,
tutos-osx-clang-py39]

include:
- name: tutos-ubuntu-gcc-py37
os: ubuntu-16.04
compiler: gcc-7
- name: tutos-ubuntu-gcc-py39
os: ubuntu-latest
compiler: gcc-9
language: "openmp"

- name: tutos-osx-gcc-py37
- name: tutos-osx-gcc-py39
os: macos-latest
compiler: gcc-9
language: "openmp"

- name: tutos-osx-clang-py37
- name: tutos-osx-clang-py39
os: macos-latest
compiler: clang
language: "C"

steps:
- name: Checkout devito_book
uses: actions/checkout@v1
uses: actions/checkout@v3

- name: Set up Python 3.7
uses: actions/setup-python@v1
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.9

- name: Install compilers for OSX
if: runner.os == 'macOS'
Expand All @@ -64,26 +63,23 @@ jobs:
else
sudo xcode-select -s /Applications/Xcode_11.app/Contents/Developer
fi
# dask error on osx, skip dask tuto
echo "::set-env name=SKIP::--deselect=examples/seismic/tutorials/04_dask.ipynb"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install matplotlib
pip install --user git+https://github.com/devitocodes/devito.git
- name: Waves (2.1 to 2.5)
run: |
cd fdm-devito-notebooks/02_wave/src-wave/wave1D
$RUN_CMD python -m pytest -W ignore::DeprecationWarning -s -v --cov . --cov-config=.coveragerc --cov-report=xml:waves_coverage.xml $SKIP wave1D_u0.py::test_constant
python -m pytest -s -v --cov . --cov-config=.coveragerc --cov-report=xml:waves_coverage.xml wave1D_u0.py::test_constant
- name: Diffusion (3.7)
run: |
cd fdm-devito-notebooks/03_diffu/src-diffu
$RUN_CMD python -m pytest -W ignore::DeprecationWarning -s -v --cov . --cov-config=.coveragerc --cov-report=xml:diffu_coverage.xml $SKIP random_walk.py
python -m pytest -s -v --cov . --cov-config=.coveragerc --cov-report=xml:diffu_coverage.xml random_walk.py


- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.6
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.name }}
Expand Down
351 changes: 133 additions & 218 deletions fdm-devito-notebooks/01_vib/vib_undamped.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions fdm-devito-notebooks/02_wave/src-wave/wave1D/wave1D_dn.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def assert_no_error(u, x, t, n):
solver(I, V, f, c, U_0, U_L, L, dt, C, T,
user_action=assert_no_error,
version='vectorized')
print U_0, U_L
print(U_0, U_L)

def test_quadratic():
"""
Expand Down Expand Up @@ -383,7 +383,7 @@ def guitar(C=1, Nx=50, animate=True, version='scalar', T=2):

cpu = viz(I, None, None, c, U_0, U_L, L, dt, C, T,
umin=-1.1, umax=1.1, version=version, animate=True)
print 'CPU time: %s version =' % version, cpu
print('CPU time: %s version =' % version, cpu)


def moving_end(C=1, Nx=50, reflecting_right_boundary=True, T=2,
Expand Down
7 changes: 5 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
pytest>=7.2,<8.0
pytest-runner
pytest-cov
nbval
cached-property
py-cpuinfo
devito<4.8.2
devito==4.7
jupyter-book
matplotlib
vtk==9.2.2
vtk
mayavi
ipyevents
ipywidgets
Expand All @@ -16,3 +18,4 @@ dipy
xvfbwrapper
scitools3
future
codecov