Skip to content

Commit

Permalink
[telemac] added telemac support
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsail committed Jul 15, 2024
1 parent 02d950c commit 8f14cb3
Show file tree
Hide file tree
Showing 65 changed files with 35,034 additions and 2,057 deletions.
45 changes: 35 additions & 10 deletions .github/workflows/conda_pip.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: "Conda + pip"


# Use login shell everywhere
# https://github.com/mamba-org/setup-micromamba/tree/fcc371cea11af9012e5e916ab2dab44b42acdaaa#about-login-shells

Expand Down Expand Up @@ -43,8 +42,10 @@ jobs:
- name: "Install Python dependencies"
run: "pip install 'black'"

- run: "black --version"

- name: "Run linters"
run: "black --check ./"
run: "black --diff ./"

run-tests:
needs: "run-linters"
Expand All @@ -64,11 +65,14 @@ jobs:
SCHISM_ENV: "SCHISM_ENV"
DELFT3D_ENV: "DELFT3D_ENV"
PYPOSEIDON_ENV: "PYPOSEIDON_ENV"
PYPOS_TEL_ENV: "PYPOS_TEL_ENV"
#
SCHISM_LOCK: locks/conda-${{ matrix.os }}-schism_${{ matrix.mpi }}.lock
DELFT3D_LOCK: locks/conda-${{ matrix.os }}-delft3d_${{ matrix.mpi }}.lock
PYPOSEIDON_LOCK: locks/conda-${{ matrix.os }}-binary-p${{ matrix.python }}.lock
PYPOS_TEL_LOCK: locks/conda-${{ matrix.os }}-binary-telemac-${{ matrix.mpi }}-p${{ matrix.python }}.lock
REQUIREMENTS_CI: locks/requirements-ci.txt
REQUIREMENTS_CI_TEL: locks/requirements-ci-telemac.txt
REQUIREMENTS_VIZ: locks/requirements-viz.txt

defaults:
Expand Down Expand Up @@ -96,6 +100,7 @@ jobs:
channel_priority: strict
channels:
- gbrey
- tomsail
- conda-forge
EOF
- run: cat ~/.condarc
Expand Down Expand Up @@ -128,6 +133,16 @@ jobs:
${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOSEIDON_ENV }}-${{ hashFiles( env.PYPOSEIDON_LOCK )}}
${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOSEIDON_ENV }}-
- name: "Cache ${{ env.PYPOS_TEL_ENV }}"
uses: actions/cache@v3
id: cache-PYPOS_TEL_ENV
with:
path: ~/micromamba/envs/${{ env.PYPOS_TEL_ENV }}
key: ${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOS_TEL_ENV }}-${{ hashFiles( env.PYPOS_TEL_LOCK )}}-${{ hashFiles( env.REQUIREMENTS_CI_TEL )}}
restore-keys: |
${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOS_TEL_ENV }}-${{ hashFiles( env.PYPOS_TEL_LOCK )}}
${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOS_TEL_ENV }}-
- name: Cache tests/data/
uses: actions/cache@v3
env:
Expand All @@ -149,11 +164,9 @@ jobs:
if: steps.cache-PYPOSEIDON_ENV.outputs.cache-hit != 'true'
run: micromamba create --yes --name ${PYPOSEIDON_ENV} -f ${PYPOSEIDON_LOCK}

- name: "Check schism version"
run: |
eval "$(micromamba shell hook)"
micromamba activate "${SCHISM_ENV}"
schism -v
- name: "Create ${{ env.PYPOS_TEL_ENV }}"
if: steps.cache-PYPOS_TEL_ENV.outputs.cache-hit != 'true'
run: micromamba create --yes --name ${PYPOS_TEL_ENV} -f ${PYPOS_TEL_LOCK}

- name: "Install python dependencies"
run: |
Expand All @@ -163,6 +176,14 @@ jobs:
python -mpip install -r "${REQUIREMENTS_CI}"
python -mpip install ./
- name: "Install python dependencies for pyposeidon + telemac"
run: |
eval "$(micromamba shell hook)"
micromamba activate "${PYPOS_TEL_ENV}"
python -mpip install -U pip
python -mpip install -r "${REQUIREMENTS_CI_TEL}"
python -mpip install ./
- name: "Run tests: Basic"
run: |
eval "$(micromamba shell hook)"
Expand All @@ -183,14 +204,18 @@ jobs:
run: |
eval "$(micromamba shell hook)"
micromamba activate "${SCHISM_ENV}"
# micromamba activate --stack "${DELFT3D_ENV}"
micromamba activate --stack "${PYPOSEIDON_ENV}"
make test_schism
- name: "Run tests: Delft"
run: |
eval "$(micromamba shell hook)"
# micromamba activate "${SCHISM_ENV}"
micromamba activate --stack "${DELFT3D_ENV}"
micromamba activate "${DELFT3D_ENV}"
micromamba activate --stack "${PYPOSEIDON_ENV}"
make test_delft
- name: "Run tests: TELEMAC"
run: |
eval "$(micromamba shell hook)"
micromamba activate "${PYPOS_TEL_ENV}"
make test_telemac
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ init:
poetry install -E viz --with dev --with docs --with test

test:
pytest -vl --durations=10 -m 'not (schism or delft or viz or slow)' -n auto
pytest -vl --durations=10 -m 'not (schism or delft or telemac or viz or slow)' -n auto

test_fail:
pytest -vl --lf --runschism --rundelft --runviz
pytest -vl --lf --runschism --rundelft --runtelemac --runviz

test_viz:
pytest -vl --durations=10 --runviz -m viz
Expand All @@ -20,8 +20,11 @@ test_schism:
test_delft:
pytest -vl --durations=10 --rundelft -m delft

test_telemac:
pytest -vl --durations=10 --runtelemac -m telemac

test_full:
pytest -vl --durations=20 --runschism --rundelft --runviz
pytest -vl --durations=20 --runschism --rundelft --runtelemac --runviz

conda_lock:
./scripts/generate_envs.sh
Expand All @@ -32,6 +35,7 @@ poetry_lock:
poetry export --without-hashes -f requirements.txt -o locks/requirements.txt
poetry export --without-hashes -f requirements.txt --extras viz -o locks/requirements-viz.txt
poetry export --without-hashes -f requirements.txt --with dev --with test -o locks/requirements-ci.txt
poetry export --without-hashes -f requirements.txt --with dev --with test --with telemac -o locks/requirements-ci-telemac.txt
poetry export --without-hashes -f requirements.txt --extras viz --with dev --with docs --with test -o locks/requirements-full.txt

lock: \
Expand Down
Loading

0 comments on commit 8f14cb3

Please sign in to comment.