Skip to content

Commit 2fcb022

Browse files
authored
Merge pull request #176 from ec-jrc/telemac
[telemac] added telemac support
2 parents eed954c + 6395256 commit 2fcb022

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+29765
-2029
lines changed

.github/workflows/conda_pip.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
- name: "Install Python dependencies"
4141
run: "pip install 'black'"
4242

43+
- run: "black --version"
44+
4345
- name: "Run linters"
4446
run: "black --diff ./"
4547

@@ -61,11 +63,14 @@ jobs:
6163
SCHISM_ENV: "SCHISM_ENV"
6264
DELFT3D_ENV: "DELFT3D_ENV"
6365
PYPOSEIDON_ENV: "PYPOSEIDON_ENV"
66+
PYPOS_TEL_ENV: "PYPOS_TEL_ENV"
6467
#
6568
SCHISM_LOCK: locks/conda-${{ matrix.os }}-schism_${{ matrix.mpi }}.lock
6669
DELFT3D_LOCK: locks/conda-${{ matrix.os }}-delft3d_${{ matrix.mpi }}.lock
6770
PYPOSEIDON_LOCK: locks/conda-${{ matrix.os }}-binary-p${{ matrix.python }}.lock
71+
PYPOS_TEL_LOCK: locks/conda-${{ matrix.os }}-binary-telemac-p${{ matrix.python }}.lock
6872
REQUIREMENTS_CI: locks/requirements-ci.txt
73+
REQUIREMENTS_CI_TEL: locks/requirements-ci-telemac.txt
6974
REQUIREMENTS_VIZ: locks/requirements-viz.txt
7075

7176
defaults:
@@ -92,6 +97,7 @@ jobs:
9297
channel_priority: strict
9398
channels:
9499
- gbrey
100+
- tomsail
95101
- conda-forge
96102
EOF
97103
- run: cat ~/.condarc
@@ -123,6 +129,16 @@ jobs:
123129
${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOSEIDON_ENV }}-${{ hashFiles( env.PYPOSEIDON_LOCK )}}
124130
${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOSEIDON_ENV }}-
125131
132+
- name: "Cache ${{ env.PYPOS_TEL_ENV }}"
133+
uses: actions/cache@v3
134+
id: cache-PYPOS_TEL_ENV
135+
with:
136+
path: ~/micromamba/envs/${{ env.PYPOS_TEL_ENV }}
137+
key: ${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOS_TEL_ENV }}-${{ hashFiles( env.PYPOS_TEL_LOCK )}}-${{ hashFiles( env.REQUIREMENTS_CI_TEL )}}
138+
restore-keys: |
139+
${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOS_TEL_ENV }}-${{ hashFiles( env.PYPOS_TEL_LOCK )}}
140+
${{ matrix.os }}-${{ matrix.python }}-${{ env.PYPOS_TEL_ENV }}-
141+
126142
- name: Cache tests/data/
127143
uses: actions/cache@v3
128144
env:
@@ -144,11 +160,9 @@ jobs:
144160
if: steps.cache-PYPOSEIDON_ENV.outputs.cache-hit != 'true'
145161
run: micromamba create --yes --name ${PYPOSEIDON_ENV} -f ${PYPOSEIDON_LOCK}
146162

147-
- name: "Check schism version"
148-
run: |
149-
eval "$(micromamba shell hook)"
150-
micromamba activate "${SCHISM_ENV}"
151-
schism -v
163+
- name: "Create ${{ env.PYPOS_TEL_ENV }}"
164+
if: steps.cache-PYPOS_TEL_ENV.outputs.cache-hit != 'true'
165+
run: micromamba create --yes --name ${PYPOS_TEL_ENV} -f ${PYPOS_TEL_LOCK}
152166

153167
- name: "Install python dependencies"
154168
run: |
@@ -158,6 +172,14 @@ jobs:
158172
python -mpip install -r "${REQUIREMENTS_CI}"
159173
python -mpip install ./
160174
175+
- name: "Install python dependencies for pyposeidon + telemac"
176+
run: |
177+
eval "$(micromamba shell hook)"
178+
micromamba activate "${PYPOS_TEL_ENV}"
179+
python -mpip install -U pip
180+
python -mpip install -r "${REQUIREMENTS_CI_TEL}"
181+
python -mpip install ./
182+
161183
- name: "Run tests: Basic"
162184
run: |
163185
eval "$(micromamba shell hook)"
@@ -178,14 +200,18 @@ jobs:
178200
run: |
179201
eval "$(micromamba shell hook)"
180202
micromamba activate "${SCHISM_ENV}"
181-
# micromamba activate --stack "${DELFT3D_ENV}"
182203
micromamba activate --stack "${PYPOSEIDON_ENV}"
183204
make test_schism
184205
185206
- name: "Run tests: Delft"
186207
run: |
187208
eval "$(micromamba shell hook)"
188-
# micromamba activate "${SCHISM_ENV}"
189-
micromamba activate --stack "${DELFT3D_ENV}"
209+
micromamba activate "${DELFT3D_ENV}"
190210
micromamba activate --stack "${PYPOSEIDON_ENV}"
191211
make test_delft
212+
213+
- name: "Run tests: TELEMAC"
214+
run: |
215+
eval "$(micromamba shell hook)"
216+
micromamba activate "${PYPOS_TEL_ENV}"
217+
make test_telemac

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ init:
66
poetry install -E viz --with dev --with docs --with test
77

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

1111
test_fail:
12-
pytest -vl --lf --runschism --rundelft --runviz
12+
pytest -vl --lf --runschism --rundelft --runtelemac --runviz
1313

1414
test_viz:
1515
pytest -vl --durations=10 --runviz -m viz
@@ -20,8 +20,11 @@ test_schism:
2020
test_delft:
2121
pytest -vl --durations=10 --rundelft -m delft
2222

23+
test_telemac:
24+
pytest -vl --durations=10 --runtelemac -m telemac
25+
2326
test_full:
24-
pytest -vl --durations=20 --runschism --rundelft --runviz
27+
pytest -vl --durations=20 --runschism --rundelft --runtelemac --runviz
2528

2629
conda_lock:
2730
./scripts/generate_envs.sh
@@ -32,6 +35,7 @@ poetry_lock:
3235
poetry export --without-hashes -f requirements.txt -o locks/requirements.txt
3336
poetry export --without-hashes -f requirements.txt --extras viz -o locks/requirements-viz.txt
3437
poetry export --without-hashes -f requirements.txt --with dev --with test -o locks/requirements-ci.txt
38+
poetry export --without-hashes -f requirements.txt --with dev --with test --with telemac -o locks/requirements-ci-telemac.txt
3539
poetry export --without-hashes -f requirements.txt --extras viz --with dev --with docs --with test -o locks/requirements-full.txt
3640

3741
lock: \

0 commit comments

Comments
 (0)