Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix netcdf issue for Hamtide tests #189

Merged
merged 7 commits into from
Aug 1, 2024
Merged

Conversation

SorooshMani-NOAA
Copy link
Collaborator

Tests that required Hamtide failed due to an issue with the latest version of netcdf library installed using pip. Fixes #188

@SorooshMani-NOAA SorooshMani-NOAA self-assigned this Jun 21, 2024
@SorooshMani-NOAA SorooshMani-NOAA force-pushed the test/fix_hamtide_nc branch 4 times, most recently from 838bbe9 to 31a9c28 Compare June 21, 2024 20:14
@SorooshMani-NOAA
Copy link
Collaborator Author

@WPringle I tried to address a couple of issues for tests to run successfully in this PR locally everything works, but now I see errors in macos version! When I look at the diff (I outputted the diff in the test for debugging) I see some section of tides that are different from the reference (on linux on my machine it's fine).

If you're working on a mac can you please run tests and see what you get?

@WPringle
Copy link
Collaborator

WPringle commented Jun 24, 2024

@SorooshMani-NOAA On Argonne linux machine using python 3.10 I'm getting a failed test for test_stations.py

@SorooshMani-NOAA
Copy link
Collaborator Author

I had to update the station references. For some reason the order of stations changed (maybe due to a change in searvey or even server side).

Make sure you have the latest reference files for local testing. What about macos? Were you able to test on a mac?

@SorooshMani-NOAA
Copy link
Collaborator Author

Thanks to @AtiehAlipour-NOAA we ran the tests on a mac machine and we get a crash from shapely:

image

The run env was created by conda with python=3.10, gdal netcdf4 and hdf5 installed using mamba/conda and the rest of packages installed using pip.

git clone https://github.com/oceanmodeling/adcircpy
cd adcircpy/
git checkout test/fix_hamtide_nc
mamba create -n adcircpytest -cconda-forge python=3.10 netcdf4 hdf5 gdal
conda activate adcircpytest
pip install -e .[testing]
pytest tests/
ls tests/data/output/

If we don't install gdal by conda we'll get an error:

image

On the CI for mac brew is used for netcdf and hdf, but the rest are installed by pip:

brew install hdf5
brew install netcdf

@SorooshMani-NOAA
Copy link
Collaborator Author

SorooshMani-NOAA commented Aug 1, 2024

After more testing via updating tests and ref files it seems the reason behind the difference is how grid-data linear is results are different between mac and linux, but I'm not sure why! See code state at 82df7cd where all calculations for point location and amp/phase are done within the test code.

@SorooshMani-NOAA SorooshMani-NOAA merged commit 7426384 into main Aug 1, 2024
12 checks passed
@SorooshMani-NOAA SorooshMani-NOAA deleted the test/fix_hamtide_nc branch August 1, 2024 19:43
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.

Fix Hamtide
2 participants