Skip to content

Commit fec6c2e

Browse files
authored
Speed up Wind Toolkit tests (#338)
This PR addresses #315 by: - Changes the data called by the Wind Toolkit tests so that they run faster - Updates the .csv files that the tests compare against - Updates a few descriptions in the metocean example, fixes a sorting issue, reduces the data downloaded there - Tests in hindcast match the notebooks and use the same cache.
1 parent b2b903d commit fec6c2e

28 files changed

+55866
-53804
lines changed

.github/workflows/generate_notebook_matrix.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@
1414
"cdip_example.ipynb": 180,
1515
"Delft3D_example.ipynb": 180,
1616
"directional_waves.ipynb": 180,
17-
"environmental_contours_example.ipynb": 720,
17+
"environmental_contours_example.ipynb": 360,
1818
"extreme_response_contour_example.ipynb": 360,
19-
"extreme_response_full_sea_state_example.ipynb": 420,
20-
"extreme_response_MLER_example.ipynb": 650,
19+
"extreme_response_full_sea_state_example.ipynb": 360,
20+
"extreme_response_MLER_example.ipynb": 360,
2121
"loads_example.ipynb": 180,
22-
"metocean_example.ipynb": 240,
23-
"mooring_example.ipynb": 300,
22+
"metocean_example.ipynb": 180,
23+
"mooring_example.ipynb": 240,
2424
"PacWave_resource_characterization_example.ipynb": 780,
2525
"power_example.ipynb": 180,
2626
"qc_example.ipynb": 180,
27-
"river_example.ipynb": 240,
27+
"river_example.ipynb": 180,
2828
"short_term_extremes_example.ipynb": 180,
2929
"SWAN_example.ipynb": 180,
30-
"tidal_example.ipynb": 240,
30+
"tidal_example.ipynb": 180,
3131
"tidal_performance_example.ipynb": 180,
3232
"upcrossing_example.ipynb": 180,
3333
"wave_example.ipynb": 180,
3434
"wecsim_example.ipynb": 180,
35-
"WPTO_hindcast_example.ipynb": 1200,
36-
"default": 300, # Default timeout for other notebooks
35+
"WPTO_hindcast_example.ipynb": 180,
36+
"default": 60, # Default timeout for other notebooks
3737
}
3838
notebooks = []
3939
for root, dirs, files in os.walk("examples"):

.github/workflows/main.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
branches:
1010
- master
1111
- develop
12+
1213
jobs:
1314
set-os:
1415
runs-on: ubuntu-latest
@@ -429,6 +430,39 @@ jobs:
429430
echo "conda activate TESTconda" >> ~/.bashrc
430431
source ~/.bashrc
431432
433+
- name: Download non-hindcast data
434+
uses: actions/download-artifact@v4
435+
with:
436+
name: data
437+
path: ~/.cache/mhkit
438+
439+
- name: Download Wave Hindcast data (if available)
440+
if: (needs.check-changes.outputs.should-run-hindcast == 'true')
441+
uses: actions/download-artifact@v4
442+
with:
443+
name: wave-hindcast-data
444+
path: ~/.cache/mhkit/wave-hindcast
445+
446+
- name: Download Wind Hindcast data (if available)
447+
if: (needs.check-changes.outputs.should-run-hindcast == 'true')
448+
uses: actions/download-artifact@v4
449+
with:
450+
name: wind-hindcast-data
451+
path: ~/.cache/mhkit/wind-hindcast
452+
453+
- name: Consolidate hindcast data
454+
if: (needs.check-changes.outputs.should-run-hindcast == 'true')
455+
run: |
456+
mkdir -p ~/.cache/mhkit/hindcast
457+
mv ~/.cache/mhkit/wave-hindcast/hindcast/* ~/.cache/mhkit/hindcast/
458+
mv ~/.cache/mhkit/wind-hindcast/hindcast/* ~/.cache/mhkit/hindcast/
459+
shell: bash
460+
461+
- name: Copy .hscfg file to examples directory
462+
shell: bash -l {0}
463+
run: |
464+
cp .hscfg examples/
465+
432466
- name: Run notebook
433467
shell: bash -l {0}
434468
run: |

0 commit comments

Comments
 (0)