Skip to content

Commit

Permalink
examples: Update latex-mathjax for tutorials and py38
Browse files Browse the repository at this point in the history
ci: Re-balance test worklfows
  • Loading branch information
georgebisbas committed Jul 18, 2023
1 parent a3ea95c commit 8460a63
Show file tree
Hide file tree
Showing 14 changed files with 126 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
python examples/cfd/example_diffusion.py
- name: Upload coverage to Codecov
if: matrix.name != 'pytest-docker-py38-gcc-omp'
if: matrix.name != 'pytest-docker-py39-gcc-omp'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
40 changes: 16 additions & 24 deletions .github/workflows/pytest-core-nompi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ jobs:
matrix:
name: [
pytest-ubuntu-py39-gcc11-noomp,
pytest-ubuntu-py311-gcc12-omp,
pytest-ubuntu-py39-gcc7-omp,
pytest-ubuntu-py38-gcc12-omp,
pytest-ubuntu-py37-gcc7-omp,
pytest-ubuntu-py310-gcc10-noomp,
pytest-ubuntu-py38-gcc8-omp,
pytest-ubuntu-py39-gcc9-omp,
pytest-osx-py38-clang-omp,
pytest-docker-py38-gcc-omp,
pytest-docker-py38-icc-omp,
pytest-docker-py38-icx-omp
pytest-osx-py37-clang-omp,
pytest-docker-py39-gcc-omp,
pytest-docker-py39-icx-omp
]
set: [base, adjoint]
include:
Expand All @@ -50,15 +49,15 @@ jobs:
language: "C"
sympy: "1.11"

- name: pytest-ubuntu-py311-gcc12-omp
python-version: '3.11'
- name: pytest-ubuntu-py38-gcc12-omp
python-version: '3.8'
os: ubuntu-22.04
arch: "gcc-12"
language: "openmp"
sympy: "1.10"

- name: pytest-ubuntu-py39-gcc7-omp
python-version: '3.9'
- name: pytest-ubuntu-py37-gcc7-omp
python-version: '3.7'
os: ubuntu-20.04
arch: "gcc-7"
language: "openmp"
Expand All @@ -85,29 +84,22 @@ jobs:
language: "openmp"
sympy: "1.9"

- name: pytest-osx-py38-clang-omp
python-version: '3.8'
- name: pytest-osx-py37-clang-omp
python-version: '3.7'
os: macos-latest
arch: "clang"
language: "C"
sympy: "1.9"

- name: pytest-docker-py38-gcc-omp
python-version: '3.8'
- name: pytest-docker-py39-gcc-omp
python-version: '3.9'
os: ubuntu-latest
arch: "gcc"
language: "openmp"
sympy: "1.12"

- name: pytest-docker-py38-icc-omp
python-version: '3.8'
os: ubuntu-22.04
arch: "icc"
language: "openmp"
sympy: "1.11"

- name: pytest-docker-py38-icx-omp
python-version: '3.8'
- name: pytest-docker-py39-icx-omp
python-version: '3.9'
os: ubuntu-22.04
arch: "icx"
language: "openmp"
Expand All @@ -120,7 +112,7 @@ jobs:
test-set: 'adjoint'

exclude:
- name: pytest-osx-py38-clang-omp
- name: pytest-osx-py37-clang-omp
set: adjoint

steps:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
env:
DEVITO_ARCH: "${{ matrix.compiler }}"
DEVITO_LANGUAGE: ${{ matrix.language }}
PYTHON_VERSION: "3.8"
PYTHON_VERSION: "3.9"

strategy:
# Prevent all build to stop if a single one fails
Expand All @@ -36,17 +36,17 @@ jobs:
]

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

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

- name: tutos-osx-clang-py37
- name: tutos-osx-clang-py39
os: macos-latest
compiler: clang
language: "C"
Expand All @@ -60,11 +60,11 @@ jobs:
- name: Checkout devito
uses: actions/checkout@v3

- name: Set up Python 3.8
if: matrix.name != 'tutos-docker-gcc-py38'
- name: Set up Python 3.9
if: "!contains(matrix.name, 'docker')"
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.9

- uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
Expand Down
4 changes: 2 additions & 2 deletions devito/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,6 @@ def humanbytes(B):
elif MB <= B < GB:
return '%d MB' % round(B / MB)
elif GB <= B < TB:
return '%d GB' % round(B / GB)
return '%.1f GB' % round(B / GB, 1)
elif TB <= B:
return '%d TB' % round(B / TB)
return '%.1f TB' % round(B / TB, 1)
4 changes: 0 additions & 4 deletions docker/Dockerfile.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@
# This Dockerfile contains the Devito codes and can be built using different base images.
##############################################################

<<<<<<< HEAD
ARG pyversion=python:3.9
=======
ARG pyversion=python:3.8
>>>>>>> 66c0b76b5 (ci: Update python versions, end-of-life for python 3.7)
ARG arch=gcc
ARG OMPI_BRANCH="v4.1.4"

Expand Down
4 changes: 2 additions & 2 deletions examples/cfd/02_convection_nonlinear.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
{
"data": {
"text/latex": [
"$\\displaystyle \\left[\\begin{matrix}\\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} \\frac{\\partial}{\\partial x} \\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} + \\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} \\frac{\\partial}{\\partial y} \\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} + \\frac{\\partial}{\\partial t} \\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)}\\\\\\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} \\frac{\\partial}{\\partial x} \\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} + \\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} \\frac{\\partial}{\\partial y} \\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} + \\frac{\\partial}{\\partial t} \\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)}\\end{matrix}\\right] = 0$"
"$\\displaystyle \\left[\\begin{matrix}U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} \\frac{\\partial}{\\partial x} U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} + U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} \\frac{\\partial}{\\partial y} U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} + \\frac{\\partial}{\\partial t} U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)}\\\\U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} \\frac{\\partial}{\\partial x} U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} + U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} \\frac{\\partial}{\\partial y} U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} + \\frac{\\partial}{\\partial t} U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)}\\end{matrix}\\right] = 0$"
],
"text/plain": [
"Eq(Vector(U_x(t, x + h_x/2, y)*Derivative(U_x(t, x + h_x/2, y), x) + U_y(t, x, y + h_y/2)*Derivative(U_x(t, x + h_x/2, y), y) + Derivative(U_x(t, x + h_x/2, y), t), U_x(t, x + h_x/2, y)*Derivative(U_y(t, x, y + h_y/2), x) + U_y(t, x, y + h_y/2)*Derivative(U_y(t, x, y + h_y/2), y) + Derivative(U_y(t, x, y + h_y/2), t)), 0)"
Expand Down Expand Up @@ -417,7 +417,7 @@
{
"data": {
"text/latex": [
"$\\displaystyle \\left[\\begin{matrix}\\operatorname{U_{x}}{\\left(t + dt,x + \\frac{h_{x}}{2},y \\right)}\\\\\\operatorname{U_{y}}{\\left(t + dt,x,y + \\frac{h_{y}}{2} \\right)}\\end{matrix}\\right] = \\left[\\begin{matrix}dt \\left(- \\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} \\frac{\\partial}{\\partial x} \\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} - \\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} \\frac{\\partial}{\\partial y} \\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} + \\frac{\\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)}}{dt}\\right)\\\\dt \\left(- \\operatorname{U_{x}}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} \\frac{\\partial}{\\partial x} \\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} - \\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} \\frac{\\partial}{\\partial y} \\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} + \\frac{\\operatorname{U_{y}}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)}}{dt}\\right)\\end{matrix}\\right]$"
"$\\displaystyle \\left[\\begin{matrix}U_{x}{\\left(t + dt,x + \\frac{h_{x}}{2},y \\right)}\\\\U_{y}{\\left(t + dt,x,y + \\frac{h_{y}}{2} \\right)}\\end{matrix}\\right] = \\left[\\begin{matrix}dt \\left(- U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} \\frac{\\partial}{\\partial x} U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} - U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} \\frac{\\partial}{\\partial y} U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} + \\frac{U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)}}{dt}\\right)\\\\dt \\left(- U_{x}{\\left(t,x + \\frac{h_{x}}{2},y \\right)} \\frac{\\partial}{\\partial x} U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} - U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} \\frac{\\partial}{\\partial y} U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)} + \\frac{U_{y}{\\left(t,x,y + \\frac{h_{y}}{2} \\right)}}{dt}\\right)\\end{matrix}\\right]$"
],
"text/plain": [
"Eq(Vector(U_x(t + dt, x + h_x/2, y), U_y(t + dt, x, y + h_y/2)), Vector(dt*(-U_x(t, x + h_x/2, y)*Derivative(U_x(t, x + h_x/2, y), x) - U_y(t, x, y + h_y/2)*Derivative(U_x(t, x + h_x/2, y), y) + U_x(t, x + h_x/2, y)/dt), dt*(-U_x(t, x + h_x/2, y)*Derivative(U_y(t, x, y + h_y/2), x) - U_y(t, x, y + h_y/2)*Derivative(U_y(t, x, y + h_y/2), y) + U_y(t, x, y + h_y/2)/dt)))"
Expand Down
142 changes: 57 additions & 85 deletions examples/cfd/04_burgers.ipynb

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions examples/cfd/08_shallow_water_equation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"0.00022222222222222223 13500\n"
"dt= 0.00022222222222222223 nt= 13500\n"
]
}
],
Expand All @@ -246,7 +246,7 @@
"Tmax = 3.\n",
"dt = 1/4500.\n",
"nt = (int)(Tmax/dt)\n",
"print(dt, nt)\n",
"print(\"dt=\", dt, \"nt=\", nt)\n",
"\n",
"x = np.linspace(0.0, Lx, num=nx)\n",
"y = np.linspace(0.0, Ly, num=ny)\n",
Expand Down Expand Up @@ -6802,6 +6802,7 @@
"metadata": {},
"outputs": [],
"source": [
"# NBVAL_IGNORE_OUTPUT\n",
"from scipy.ndimage import gaussian_filter\n",
"\n",
"# Define constant ocean depth profile h = 30 m\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/seismic/tutorials/05_staggered_acoustic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
{
"data": {
"text/latex": [
"$\\displaystyle \\left[\\begin{matrix}\\operatorname{v_{x}}{\\left(t + dt,x + \\frac{h_{x}}{2},z \\right)}\\\\\\operatorname{v_{z}}{\\left(t + dt,x,z + \\frac{h_{z}}{2} \\right)}\\end{matrix}\\right] = \\left[\\begin{matrix}dt \\left(\\frac{\\partial}{\\partial x} p{\\left(t,x,z \\right)} + \\frac{\\operatorname{v_{x}}{\\left(t,x + \\frac{h_{x}}{2},z \\right)}}{dt}\\right)\\\\dt \\left(\\frac{\\partial}{\\partial z} p{\\left(t,x,z \\right)} + \\frac{\\operatorname{v_{z}}{\\left(t,x,z + \\frac{h_{z}}{2} \\right)}}{dt}\\right)\\end{matrix}\\right]$"
"$\\displaystyle \\left[\\begin{matrix}v_{x}{\\left(t + dt,x + \\frac{h_{x}}{2},z \\right)}\\\\v_{z}{\\left(t + dt,x,z + \\frac{h_{z}}{2} \\right)}\\end{matrix}\\right] = \\left[\\begin{matrix}dt \\left(\\frac{\\partial}{\\partial x} p{\\left(t,x,z \\right)} + \\frac{v_{x}{\\left(t,x + \\frac{h_{x}}{2},z \\right)}}{dt}\\right)\\\\dt \\left(\\frac{\\partial}{\\partial z} p{\\left(t,x,z \\right)} + \\frac{v_{z}{\\left(t,x,z + \\frac{h_{z}}{2} \\right)}}{dt}\\right)\\end{matrix}\\right]$"
],
"text/plain": [
"Eq(Vector(v_x(t + dt, x + h_x/2, z), v_z(t + dt, x, z + h_z/2)), Vector(dt*(Derivative(p(t, x, z), x) + v_x(t, x + h_x/2, z)/dt), dt*(Derivative(p(t, x, z), z) + v_z(t, x, z + h_z/2)/dt)))"
Expand All @@ -145,7 +145,7 @@
{
"data": {
"text/latex": [
"$\\displaystyle p{\\left(t + dt,x,z \\right)} = dt \\left(16.0 \\frac{\\partial}{\\partial x} \\operatorname{v_{x}}{\\left(t + dt,x + \\frac{h_{x}}{2},z \\right)} + 16.0 \\frac{\\partial}{\\partial z} \\operatorname{v_{z}}{\\left(t + dt,x,z + \\frac{h_{z}}{2} \\right)} + \\frac{p{\\left(t,x,z \\right)}}{dt}\\right)$"
"$\\displaystyle p{\\left(t + dt,x,z \\right)} = dt \\left(16.0 \\frac{\\partial}{\\partial x} v_{x}{\\left(t + dt,x + \\frac{h_{x}}{2},z \\right)} + 16.0 \\frac{\\partial}{\\partial z} v_{z}{\\left(t + dt,x,z + \\frac{h_{z}}{2} \\right)} + \\frac{p{\\left(t,x,z \\right)}}{dt}\\right)$"
],
"text/plain": [
"Eq(p(t + dt, x, z), dt*(16.0*Derivative(v_x(t + dt, x + h_x/2, z), x) + 16.0*Derivative(v_z(t + dt, x, z + h_z/2), z) + p(t, x, z)/dt))"
Expand Down
2 changes: 1 addition & 1 deletion examples/seismic/tutorials/06_elastic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
{
"data": {
"text/latex": [
"$\\displaystyle \\left[\\begin{matrix}\\operatorname{v_{x}}{\\left(t + dt,x + \\frac{h_{x}}{2},z \\right)}\\\\\\operatorname{v_{z}}{\\left(t + dt,x,z + \\frac{h_{z}}{2} \\right)}\\end{matrix}\\right] = \\left[\\begin{matrix}dt \\left(0.555555555555556 \\frac{\\partial}{\\partial x} \\operatorname{t_{xx}}{\\left(t,x,z \\right)} + 0.555555555555556 \\frac{\\partial}{\\partial z} \\operatorname{t_{xz}}{\\left(t,x + \\frac{h_{x}}{2},z + \\frac{h_{z}}{2} \\right)} + \\frac{\\operatorname{v_{x}}{\\left(t,x + \\frac{h_{x}}{2},z \\right)}}{dt}\\right)\\\\dt \\left(0.555555555555556 \\frac{\\partial}{\\partial x} \\operatorname{t_{xz}}{\\left(t,x + \\frac{h_{x}}{2},z + \\frac{h_{z}}{2} \\right)} + 0.555555555555556 \\frac{\\partial}{\\partial z} \\operatorname{t_{zz}}{\\left(t,x,z \\right)} + \\frac{\\operatorname{v_{z}}{\\left(t,x,z + \\frac{h_{z}}{2} \\right)}}{dt}\\right)\\end{matrix}\\right]$"
"$\\displaystyle \\left[\\begin{matrix}v_{x}{\\left(t + dt,x + \\frac{h_{x}}{2},z \\right)}\\\\v_{z}{\\left(t + dt,x,z + \\frac{h_{z}}{2} \\right)}\\end{matrix}\\right] = \\left[\\begin{matrix}dt \\left(0.555555555555556 \\frac{\\partial}{\\partial x} t_{xx}{\\left(t,x,z \\right)} + 0.555555555555556 \\frac{\\partial}{\\partial z} t_{xz}{\\left(t,x + \\frac{h_{x}}{2},z + \\frac{h_{z}}{2} \\right)} + \\frac{v_{x}{\\left(t,x + \\frac{h_{x}}{2},z \\right)}}{dt}\\right)\\\\dt \\left(0.555555555555556 \\frac{\\partial}{\\partial x} t_{xz}{\\left(t,x + \\frac{h_{x}}{2},z + \\frac{h_{z}}{2} \\right)} + 0.555555555555556 \\frac{\\partial}{\\partial z} t_{zz}{\\left(t,x,z \\right)} + \\frac{v_{z}{\\left(t,x,z + \\frac{h_{z}}{2} \\right)}}{dt}\\right)\\end{matrix}\\right]$"
],
"text/plain": [
"Eq(Vector(v_x(t + dt, x + h_x/2, z), v_z(t + dt, x, z + h_z/2)), Vector(dt*(0.555555555555556*Derivative(t_xx(t, x, z), x) + 0.555555555555556*Derivative(t_xz(t, x + h_x/2, z + h_z/2), z) + v_x(t, x + h_x/2, z)/dt), dt*(0.555555555555556*Derivative(t_xz(t, x + h_x/2, z + h_z/2), x) + 0.555555555555556*Derivative(t_zz(t, x, z), z) + v_z(t, x, z + h_z/2)/dt)))"
Expand Down
Loading

0 comments on commit 8460a63

Please sign in to comment.