Skip to content
Merged
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
5 changes: 2 additions & 3 deletions .github/workflows/code_compatibility_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ jobs:

matrix:
# os: [macos-13, ubuntu-latest, windows-latest]
os: [ubuntu-latest]
python-version: [3.8, 3.9, "3.10", 3.11]
matlab-version: [R2021b, R2022a, R2022b, R2023a, R2023b]
os: ["ubuntu-22.04"]
matlab-version: [R2022b, R2023a, R2023b, R2024a, R2024b, R2025a, latest]

runs-on: ${{ matrix.os }}

Expand Down
32 changes: 24 additions & 8 deletions .github/workflows/unix_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
fail-fast: false

matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
matlab-version: [R2022b]
os: ["ubuntu-22.04"]
python-version: ["3.11"]
matlab-version: [R2023b]

runs-on: ${{ matrix.os }}

Expand All @@ -37,6 +37,12 @@ jobs:
conda activate mhkit_conda_env
conda install numpy cython pip pytest hdf5 libnetcdf cftime netcdf4

- name: Fix libstdc++ compatibility
if: matrix.os == 'ubuntu-22.04'
run: |
# Force MATLAB to use system libstdc++
echo "LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/lib/x86_64-linux-gnu/libstdc++.so.6" >> "$GITHUB_ENV"

- name: Check out MHKiT-MATLAB
uses: actions/checkout@v4

Expand Down Expand Up @@ -122,15 +128,15 @@ jobs:
fail-fast: false

matrix:
os: [macos-13, ubuntu-latest]
os: [macos-13, "ubuntu-22.04"]
python-version: ["3.10", 3.11, 3.12]
# Note: It is preferred to use an actual release name as opposed to 'latest'
matlab-version: [R2022b, R2023a, R2023b, R2024a, R2024b]
mhkit-python-version: ["0.9.0"]
exclude:
- python-version: "3.10" # cache_population job
matlab-version: R2022b
os: ubuntu-latest
os: "ubuntu-22.04"
# Python 3.12 + MATLAB incompatability
- matlab-version: R2024a
python-version: 3.12
Expand All @@ -153,6 +159,10 @@ jobs:
- matlab-version: R2024b
python-version: 3.12
os: macos-13
# Unable to resolve the name 'py.mhkit.wave.resource.jonswap_spectrum'
- matlab-version: R2023a
python-version: 3.10
os: "ubuntu-22.04"

runs-on: ${{ matrix.os }}

Expand All @@ -179,9 +189,15 @@ jobs:
conda activate mhkit_conda_env
conda install numpy cython pip pytest hdf5 libnetcdf cftime netcdf4

- name: Setup MATLAB Path on Ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: echo "LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6" >> "$GITHUB_ENV"
- name: Fix libstdc++ compatibility
if: matrix.os == 'ubuntu-22.04'
run: |
# Force MATLAB to use system libstdc++
echo "LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/lib/x86_64-linux-gnu/libstdc++.so.6" >> "$GITHUB_ENV"

# - name: Setup MATLAB Path on Ubuntu
# if: ${{ matrix.os == '"ubuntu-22.04"' }}
# run: echo "LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6" >> "$GITHUB_ENV"

- name: Print Python executable
shell: bash -l {0}
Expand Down
41 changes: 39 additions & 2 deletions .github/workflows/windows_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ["3.10"]
python-version: ["3.11"]
matlab-version: [R2023b]
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -80,6 +80,14 @@ jobs:
with:
release: ${{ matrix.matlab-version }}

- name: Set PYBIND11 GIL workaround
# if: ${{ matrix.matlab-version == 'R2025a' }}
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
export PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF=1
echo "PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF=1" >> $GITHUB_ENV

- name: Configure MATLAB pyenv Version and ExecutionMode
if: ${{ matrix.os == 'windows-latest' }}
shell: pwsh
Expand Down Expand Up @@ -128,7 +136,8 @@ jobs:
matrix:
os: [windows-latest]
python-version: ["3.10", 3.11, 3.12]
matlab-version: [R2022b, R2023a, R2023b, R2024a, R2024b]
# matlab-version: [R2022b, R2023a, R2023b, R2024a, R2024b]
matlab-version: [R2023a, R2023b, R2024a, R2024b]
mhkit-python-version: ["0.9.0"]
exclude:
# Cache population job
Expand All @@ -150,6 +159,11 @@ jobs:
python-version: 3.11
- matlab-version: R2022b
python-version: 3.11
# Failing Job
# Python Error: ImportError: DLL load failed while importing pyexpat: The operating system cannot run %1
- matlab-version: R2023a
python-version: "3.10"

runs-on: ${{ matrix.os }}

env:
Expand Down Expand Up @@ -197,6 +211,21 @@ jobs:
# pip uninstall -y scipy
# pip install scipy==1.10.1
#

# Some tests fail with:
# Python Error: ImportError: DLL load failed while importing pyexpat: The operating system cannot run %1.
# One potential fix is to install expat and lxml
- name: Install Windows XML dependencies
if: ${{ matrix.os == 'windows-latest' }}
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
# Simple single package install to avoid solver issues
conda install expat -y
# Alternative: use pip for XML parsing
pip install lxml


- name: List installed pip modules
shell: bash -l {0}
run: |
Expand Down Expand Up @@ -227,6 +256,14 @@ jobs:
with:
release: ${{ matrix.matlab-version }}

- name: Set PYBIND11 GIL workaround
# if: ${{ matrix.matlab-version == 'R2025a' }}
shell: bash -l {0}
run: |
conda activate mhkit_conda_env
export PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF=1
echo "PYBIND11_NO_ASSERT_GIL_HELD_INCREF_DECREF=1" >> $GITHUB_ENV

- name: Add Python Dir to Path
shell: bash -l {0}
run: |
Expand Down
6 changes: 3 additions & 3 deletions mhkit/tests/Wave_TestIO.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function test_swan_read_block(testCase)
% WPTO multiple locations
function test_WPTO_point_multiloc(testCase)

% assumeFail(testCase, "API key usage saturated - temporarily disabling")
assumeFail(testCase, "API key usage saturated - temporarily disabling")
% Error using matlab.internal.webservices.HTTPConnector/copyContentToByteArray (line 373)
% The server returned the status 503 with message "Service Unavailable" in response to the request to URL
% https://developer.nrel.gov/api/hsds/?api_key=3K3JQbjZmWctY0xmIfSYvYgtIcM3CN0cb1Y2w9bf&domain=%2Fnrel%2FUS_wave%2Fvirtual_buoy%2FWest_Coast%2FWest_Coast_virtual_buoy_2010.h5.
Expand Down Expand Up @@ -147,7 +147,7 @@ function test_WPTO_point_multiloc(testCase)

function test_WPTO_omnidirectional(testCase)

% assumeFail(testCase, "API key usage saturated - temporarily disabling")
assumeFail(testCase, "API key usage saturated - temporarily disabling")

api_key = '3K3JQbjZmWctY0xmIfSYvYgtIcM3CN0cb1Y2w9bf';
hindcast_data = request_wpto('1-hour',...
Expand Down Expand Up @@ -178,7 +178,7 @@ function test_WPTO_omnidirectional(testCase)

function test_WPTO_point_multiparm(testCase)

% assumeFail(testCase, "API key usage saturated - temporarily disabling")
assumeFail(testCase, "API key usage saturated - temporarily disabling")

api_key = '3K3JQbjZmWctY0xmIfSYvYgtIcM3CN0cb1Y2w9bf';
hindcast_data = request_wpto('3-hour',...
Expand Down
Loading