Skip to content

Commit

Permalink
Fix codecov reports (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrjones authored Jun 18, 2024
1 parent 5bfeaec commit ec958b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
if: github.repository == 'carbonplan/ndpyramid'
name: ${{ matrix.python-version }}-build
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for requesting OIDC token for codecov
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -51,9 +53,11 @@ jobs:
conda list
- name: Run tests
run: |
python -m pytest
python -m pytest --cov=./ --cov-report=xml --verbose
- name: Upload coverage to Codecov
if: ${{ matrix.python-version }} == "3.11"
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
use_oidc: true
4 changes: 2 additions & 2 deletions tests/test_pyramids.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_resampled_pyramid(temperature, benchmark, resampling):
pytest.importorskip('rioxarray')
levels = 2
temperature = temperature.rio.write_crs('EPSG:4326')
temperature = temperature.isel(time=0).drop('time')
temperature = temperature.transpose('time', 'lat', 'lon')
# import pdb; pdb.set_trace()

pyramid = benchmark(
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_resampled_pyramid_2D(temperature, benchmark):
pytest.importorskip('rioxarray')
levels = 2
temperature = temperature.rio.write_crs('EPSG:4326')
temperature = temperature.isel(time=0).drop('time')
temperature = temperature.isel(time=0).drop_vars('time')
pyramid = benchmark(lambda: pyramid_resample(temperature, levels=levels, x='lon', y='lat'))
verify_bounds(pyramid)
assert pyramid.ds.attrs['multiscales']
Expand Down

0 comments on commit ec958b3

Please sign in to comment.