Skip to content

Commit

Permalink
Update tests and GitHub CI workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
EricEngle-NOAA committed Nov 30, 2023
1 parent 0dc99b2 commit cc2c20c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
- name: Install NCEPLIBS-g2c
run: |
wget https://github.com/NOAA-EMC/NCEPLIBS-g2c/archive/refs/tags/v1.7.0.tar.gz
tar -xzvf v1.7.0.tar.gz
cd NCEPLIBS-g2c-1.7.0
wget https://github.com/NOAA-EMC/NCEPLIBS-g2c/archive/refs/tags/v1.8.0.tar.gz
tar -xzvf v1.8.0.tar.gz
cd NCEPLIBS-g2c-1.8.0
mkdir build && cd build
cmake -DUSE_Jasper=OFF -DUSE_OpenJPEG=ON -DBUILD_SHARED_LIBS=ON ..
make -j2
Expand All @@ -45,6 +45,4 @@ jobs:
run: |
python --version
pip install .
cd /tmp # Get out out source package
python -c "import grib2io; print(grib2io)"
python -c "import xarray; print(xarray.backends.list_engines().keys())"
pytest ./tests/
4 changes: 1 addition & 3 deletions .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,4 @@ jobs:
run: |
python --version
pip install .
cd /tmp # Get out of source package
python -c "import grib2io; print(grib2io)"
python -c "import xarray; print(xarray.backends.list_engines().keys())"
pytest ./tests/
7 changes: 5 additions & 2 deletions tests/test_grib2_read_unpack.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import pytest
import grib2io

if __name__ == '__main__':
g = grib2io.open('./data/gfs.t00z.pgrb2.1p00.f024')
def test_read_unpack_data(request):
grib2file = request.config.rootdir / 'tests' / 'data' / 'gfs.t00z.pgrb2.1p00.f024'
g = grib2io.open(grib2file)
for msg in g:
msg.__str__()
msg.data
g.close()
6 changes: 1 addition & 5 deletions tests/test_xarray_backend.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import pytest
import xarray as xr
import grib2io
import numpy as np
import datetime

def test_nemed_filter(request):
def test_named_filter(request):
data = request.config.rootdir / 'tests' / 'data'
filters = dict(productDefinitionTemplateNumber=0, typeOfFirstFixedSurface=1)
ds1 = xr.open_dataset(data / 'gfs.t00z.pgrb2.1p00.f024', engine='grib2io', filters=filters)
filters = dict(productDefinitionTemplateNumber=0, typeOfFirstFixedSurface='Ground or Water Surface')
ds2 = xr.open_dataset(data / 'gfs.t00z.pgrb2.1p00.f024', engine='grib2io', filters=filters)

xr.testing.assert_equal(ds1, ds2)

def test_multi_lead(request):
Expand Down

0 comments on commit cc2c20c

Please sign in to comment.