Skip to content

Conversation

@simmsa
Copy link
Contributor

@simmsa simmsa commented Oct 15, 2025

Status: Ready

This is a fix for failing pip tests in main.yml:

https://github.com/MHKiT-Software/MHKiT-Python/actions/runs/18511807517/job/52754343805?pr=421
https://github.com/MHKiT-Software/MHKiT-Python/actions/runs/18511807517/job/52754343883?pr=421

There are lots of errors in both of these tests related to h5 and netcdf4. One fix for this is installing the system h5 and nc binaries and having pip rebuild against these binaries

jmcvey3 and others added 18 commits May 8, 2024 12:07
This removes automatic module loading of the heavy wave.io module and is
meant to fix cross module loading of unnecessary submodules.

One example: `import loads` when installed via pip install
"mhkit[loads]" imports `wave.resource.frequency_moment`, which also
imports the unnecessary wave.io module which has a dependency on
requests. This fails if the user doesn't have `requests` installed, but
that module is not necessary to run `frequency_moment`.
Loads module tests call wave/contours.py which requires `statsmodels`
`requests` is small, common python library. There are some modules that
pull from multiple modules (loads calls wave) which require `requests`.
This always includes requests for all modules.
Loads tests call wave.contours, which need scikit-learn
@simmsa simmsa marked this pull request as ready for review October 16, 2025 14:22
@simmsa
Copy link
Contributor Author

simmsa commented Oct 16, 2025

@akeeste, this is ready for review. This installs system binaries of h5 and netcdf libraries on linux and then reinstalls and builds h5py and netcdf python libraries using these binaries.

This should fix all variations of these errors in the pip-ubuntu-latest/* tests:

ERROR .github/workflows/mhkit/tests/dolfyn/test_analysis.py - OSError: [Errno -101] NetCDF: HDF error: '/home/runner/work/MHKiT-Python/MHKiT-Python/examples/data/dolfyn/test_data/RDI_test01.nc'
src/netCDF4/_netCDF4.pyx:2517: in netCDF4._netCDF4.Dataset.__init__
    ???
src/netCDF4/_netCDF4.pyx:2154: in netCDF4._netCDF4._ensure_nc_success
    ???
E   OSError: [Errno -101] NetCDF: HDF error: '/home/runner/work/MHKiT-Python/MHKiT-Python/examples/data/dolfyn/test_data/RDI_test01.nc'

@simmsa
Copy link
Contributor Author

simmsa commented Oct 16, 2025

These specific tests are passing, indicating that this fix works:

image

https://github.com/MHKiT-Software/MHKiT-Python/actions/runs/18564411952

@simmsa simmsa mentioned this pull request Oct 16, 2025
@simmsa simmsa requested a review from akeeste October 16, 2025 16:39
@akeeste
Copy link
Contributor

akeeste commented Oct 16, 2025

Thanks @simmsa. Like #421, I'm going to switch this into main and merge

@akeeste akeeste changed the base branch from develop to main October 16, 2025 19:58
@akeeste akeeste merged commit 9fbc192 into MHKiT-Software:main Oct 16, 2025
46 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants