Skip to content

Commit

Permalink
Merge pull request #189 from oceanmodeling/test/fix_hamtide_nc
Browse files Browse the repository at this point in the history
Fix netcdf issue for Hamtide tests
  • Loading branch information
SorooshMani-NOAA authored Aug 1, 2024
2 parents 2263910 + 976c57d commit 7426384
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 50 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/quick_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: install Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.11'
- name: load cached Python installation
id: cache
uses: actions/cache@v3
Expand All @@ -46,7 +46,7 @@ jobs:
- name: install Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.11'
- name: load cached Python installation
id: cache
uses: actions/cache@v3
Expand All @@ -59,5 +59,6 @@ jobs:
sudo apt install libhdf5-dev
sudo apt install libnetcdf-dev
pip install ".[testing]"
python -m pip install --upgrade --force-reinstall --no-deps --no-cache-dir netcdf4 --no-binary netcdf4
- name: run tests
run: pytest --numprocesses auto
16 changes: 10 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: install Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.11'
- name: load cached Python installation
id: cache
uses: actions/cache@v3
Expand All @@ -46,10 +46,10 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
python-version: [ '3.8', '3.9', '3.10', '3.x' ]
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
exclude:
- os: macos-latest
python-version: '3.x'
python-version: '3.11'
steps:
- name: clone repository
uses: actions/checkout@v3
Expand All @@ -75,7 +75,9 @@ jobs:
brew install netcdf
if: runner.os == 'macOS'
- name: install repo
run: pip install ".[testing]"
run: |
pip install ".[testing]"
python -m pip install --upgrade --force-reinstall --no-deps --no-cache-dir netcdf4 --no-binary netcdf4
- name: run tests
run: pytest --numprocesses auto
test_with_coverage:
Expand All @@ -88,7 +90,7 @@ jobs:
- name: install Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.11'
- name: load cached Python installation
id: cache
uses: actions/cache@v3
Expand All @@ -107,7 +109,9 @@ jobs:
brew install netcdf
if: runner.os == 'macOS'
- name: install repo
run: pip install ".[testing]"
run: |
pip install ".[testing]"
python -m pip install --upgrade --force-reinstall --no-deps --no-cache-dir netcdf4 --no-binary netcdf4
- name: run tests with coverage
run: pytest --numprocesses auto --cov . --cov-report xml:coverage.xml
- name: show coverage report
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ build-backend = 'poetry.core.masonry.api'
enable = true

[tool.poetry.dependencies]
python = '^3.8'
python = '^3.8, <3.12'
appdirs = '*'
dunamai = { version = '*', optional = true }
geopandas = '<0.11'
haversine = '*'
matplotlib = '*'
matplotlib = '<3.9'
netCDF4 = '*'
numpy = '*'
pandas = '*'
Expand All @@ -37,10 +37,10 @@ pooch = '*'
psutil = '*'
pyproj = '>=2.6'
requests = '*'
scipy = '*'
scipy = '<=1.12'
searvey = '*'
shapely = '*'
stormevents = '>=2.1.3' # tests rely on new field widths
stormevents = '>=2.3.2' # tests results based on speed fix
typepigeon = '<2' # newer versions require code update
utm = '*'
isort = { version = '*', optional = true }
Expand Down
2 changes: 1 addition & 1 deletion tests/data/reference/example_3/fort.15.coldstart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
created on 2023-09-01 11:20 ! RUNDES - 32 CHARACTER ALPHANUMERIC RUN DESCRIPTION
created on 2024-08-01 09:48 ! RUNDES - 32 CHARACTER ALPHANUMERIC RUN DESCRIPTION
Shinacock Inlet Coarse Grid ! RUNID - 24 CHARACTER ALPANUMERIC RUN IDENTIFICATION
1 ! NFOVER - NONFATAL ERROR OVERRIDE OPTION
1 ! NABOUT - ABREVIATED OUTPUT OPTION PARAMETER
Expand Down
2 changes: 1 addition & 1 deletion tests/data/reference/example_3/fort.15.hotstart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
created on 2023-09-01 11:21 ! RUNDES - 32 CHARACTER ALPHANUMERIC RUN DESCRIPTION
created on 2024-08-01 09:48 ! RUNDES - 32 CHARACTER ALPHANUMERIC RUN DESCRIPTION
Shinacock Inlet Coarse Grid ! RUNID - 24 CHARACTER ALPANUMERIC RUN IDENTIFICATION
1 ! NFOVER - NONFATAL ERROR OVERRIDE OPTION
1 ! NABOUT - ABREVIATED OUTPUT OPTION PARAMETER
Expand Down
2 changes: 1 addition & 1 deletion tests/data/reference/example_3/fort.22
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AL, 18, 2012102118, , BEST, 0, 143N, 774W, 25, 1006, LO, 0, , 0, 0, 0, 0, 1008, 180, 150, 35, 0, L, 0, , 0, 0, INVEST, 1
AL, 18, 2012102118, , BEST, 0, 143N, 774W, 25, 1006, LO, 0, , 0, 0, 0, 0, 1008, 180, 150, 35, 0, L, 0, , 224, 3, INVEST, 1
AL, 18, 2012102200, , BEST, 0, 139N, 778W, 25, 1005, LO, 0, , 0, 0, 0, 0, 1008, 180, 150, 35, 0, L, 0, , 224, 3, INVEST, 2
AL, 18, 2012102206, , BEST, 0, 135N, 782W, 25, 1003, LO, 0, , 0, 0, 0, 0, 1008, 225, 75, 35, 0, L, 0, , 224, 3, INVEST, 3
AL, 18, 2012102212, , BEST, 0, 131N, 786W, 30, 1002, TD, 0, , 0, 0, 0, 0, 1007, 250, 75, 0, 0, L, 0, , 224, 3, EIGHTEEN, 4
Expand Down
52 changes: 24 additions & 28 deletions tests/data/reference/test_Stations/stations_1.fort.15
Original file line number Diff line number Diff line change
@@ -1,55 +1,51 @@
13 ! NSTAE
-75.74669647216797 36.18330001831055 ! 8651370
12 ! NSTAE
-78.91829681396484 33.654998779296875 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.54818725585938 35.79568862915039 ! 8652587
-75.70419311523438 35.20861053466797 ! 8654467
-77.95361328125 34.227500915527344 ! 8658120
-80.90303039550781 32.034690856933594 ! 8670870
-77.78668975830078 34.21331024169922 ! 8658163
-78.91638946533203 33.65555953979492 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.70419311523438 35.20861053466797 ! 8654467
-80.90303039550781 32.034690856933594 ! 8670870
-79.70670318603516 32.8567008972168 ! 8664941
-80.46499633789062 32.34000015258789 ! 8668498
-78.50669860839844 33.8650016784668 ! 8659897
-75.63500213623047 35.22330093383789 ! 8654400
13 ! NSTAV
-75.74669647216797 36.18330001831055 ! 8651370
12 ! NSTAV
-78.91829681396484 33.654998779296875 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.54818725585938 35.79568862915039 ! 8652587
-75.70419311523438 35.20861053466797 ! 8654467
-77.95361328125 34.227500915527344 ! 8658120
-80.90303039550781 32.034690856933594 ! 8670870
-77.78668975830078 34.21331024169922 ! 8658163
-78.91638946533203 33.65555953979492 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.70419311523438 35.20861053466797 ! 8654467
-80.90303039550781 32.034690856933594 ! 8670870
-79.70670318603516 32.8567008972168 ! 8664941
-80.46499633789062 32.34000015258789 ! 8668498
-78.50669860839844 33.8650016784668 ! 8659897
-75.63500213623047 35.22330093383789 ! 8654400
13 ! NSTAC
-75.74669647216797 36.18330001831055 ! 8651370
12 ! NSTAC
-78.91829681396484 33.654998779296875 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.54818725585938 35.79568862915039 ! 8652587
-75.70419311523438 35.20861053466797 ! 8654467
-77.95361328125 34.227500915527344 ! 8658120
-80.90303039550781 32.034690856933594 ! 8670870
-77.78668975830078 34.21331024169922 ! 8658163
-78.91638946533203 33.65555953979492 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.70419311523438 35.20861053466797 ! 8654467
-80.90303039550781 32.034690856933594 ! 8670870
-79.70670318603516 32.8567008972168 ! 8664941
-80.46499633789062 32.34000015258789 ! 8668498
-78.50669860839844 33.8650016784668 ! 8659897
-75.63500213623047 35.22330093383789 ! 8654400
13 ! NSTAM
-75.74669647216797 36.18330001831055 ! 8651370
12 ! NSTAM
-78.91829681396484 33.654998779296875 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.54818725585938 35.79568862915039 ! 8652587
-75.70419311523438 35.20861053466797 ! 8654467
-77.95361328125 34.227500915527344 ! 8658120
-80.90303039550781 32.034690856933594 ! 8670870
-77.78668975830078 34.21331024169922 ! 8658163
-78.91638946533203 33.65555953979492 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.70419311523438 35.20861053466797 ! 8654467
-80.90303039550781 32.034690856933594 ! 8670870
-79.70670318603516 32.8567008972168 ! 8664941
-80.46499633789062 32.34000015258789 ! 8668498
-78.50669860839844 33.8650016784668 ! 8659897
Expand Down
13 changes: 6 additions & 7 deletions tests/data/reference/test_Stations/stations_2.fort.15
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
13 ! NSTAE
-75.74669647216797 36.18330001831055 ! 8651370
12 ! NSTAE
-78.91829681396484 33.654998779296875 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.54818725585938 35.79568862915039 ! 8652587
-75.70419311523438 35.20861053466797 ! 8654467
-77.95361328125 34.227500915527344 ! 8658120
-80.90303039550781 32.034690856933594 ! 8670870
-77.78668975830078 34.21331024169922 ! 8658163
-78.91638946533203 33.65555953979492 ! 8661070
-76.67066192626953 34.71733093261719 ! 8656483
-79.9236068725586 32.78083038330078 ! 8665530
-75.70419311523438 35.20861053466797 ! 8654467
-80.90303039550781 32.034690856933594 ! 8670870
-79.70670318603516 32.8567008972168 ! 8664941
-80.46499633789062 32.34000015258789 ! 8668498
-78.50669860839844 33.8650016784668 ! 8659897
Expand Down

0 comments on commit 7426384

Please sign in to comment.