Skip to content

Commit

Permalink
Speed up Wind Toolkit tests (#338)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
akeeste authored and ssolson committed Aug 13, 2024
1 parent f843cd1 commit a52e0c0
Show file tree
Hide file tree
Showing 28 changed files with 55,866 additions and 53,804 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/generate_notebook_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,26 @@
"cdip_example.ipynb": 180,
"Delft3D_example.ipynb": 180,
"directional_waves.ipynb": 180,
"environmental_contours_example.ipynb": 720,
"environmental_contours_example.ipynb": 360,
"extreme_response_contour_example.ipynb": 360,
"extreme_response_full_sea_state_example.ipynb": 420,
"extreme_response_MLER_example.ipynb": 650,
"extreme_response_full_sea_state_example.ipynb": 360,
"extreme_response_MLER_example.ipynb": 360,
"loads_example.ipynb": 180,
"metocean_example.ipynb": 240,
"mooring_example.ipynb": 300,
"metocean_example.ipynb": 180,
"mooring_example.ipynb": 240,
"PacWave_resource_characterization_example.ipynb": 780,
"power_example.ipynb": 180,
"qc_example.ipynb": 180,
"river_example.ipynb": 240,
"river_example.ipynb": 180,
"short_term_extremes_example.ipynb": 180,
"SWAN_example.ipynb": 180,
"tidal_example.ipynb": 240,
"tidal_example.ipynb": 180,
"tidal_performance_example.ipynb": 180,
"upcrossing_example.ipynb": 180,
"wave_example.ipynb": 180,
"wecsim_example.ipynb": 180,
"WPTO_hindcast_example.ipynb": 1200,
"default": 300, # Default timeout for other notebooks
"WPTO_hindcast_example.ipynb": 180,
"default": 60, # Default timeout for other notebooks
}
notebooks = []
for root, dirs, files in os.walk("examples"):
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches:
- master
- develop

jobs:
set-os:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -429,6 +430,39 @@ jobs:
echo "conda activate TESTconda" >> ~/.bashrc
source ~/.bashrc

- name: Download non-hindcast data
uses: actions/download-artifact@v4
with:
name: data
path: ~/.cache/mhkit

- name: Download Wave Hindcast data (if available)
if: (needs.check-changes.outputs.should-run-hindcast == 'true')
uses: actions/download-artifact@v4
with:
name: wave-hindcast-data
path: ~/.cache/mhkit/wave-hindcast

- name: Download Wind Hindcast data (if available)
if: (needs.check-changes.outputs.should-run-hindcast == 'true')
uses: actions/download-artifact@v4
with:
name: wind-hindcast-data
path: ~/.cache/mhkit/wind-hindcast

- name: Consolidate hindcast data
if: (needs.check-changes.outputs.should-run-hindcast == 'true')
run: |
mkdir -p ~/.cache/mhkit/hindcast
mv ~/.cache/mhkit/wave-hindcast/hindcast/* ~/.cache/mhkit/hindcast/
mv ~/.cache/mhkit/wind-hindcast/hindcast/* ~/.cache/mhkit/hindcast/
shell: bash

- name: Copy .hscfg file to examples directory
shell: bash -l {0}
run: |
cp .hscfg examples/

- name: Run notebook
shell: bash -l {0}
run: |
Expand Down
Loading

0 comments on commit a52e0c0

Please sign in to comment.