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

[telemac] added telemac support #176

Open
wants to merge 1 commit 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
42 changes: 34 additions & 8 deletions .github/workflows/conda_pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
- name: "Install Python dependencies"
run: "pip install 'black'"

- run: "black --version"

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

Expand All @@ -61,11 +63,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-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 All @@ -92,6 +97,7 @@ jobs:
channel_priority: strict
channels:
- gbrey
- tomsail
- conda-forge
EOF
- run: cat ~/.condarc
Expand Down Expand Up @@ -123,6 +129,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 @@ -144,11 +160,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 @@ -158,6 +172,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 @@ -178,14 +200,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
Loading