Skip to content

Codecov: disable Numba; ignore tests, experimental, and gpu_rtx #673

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

Merged
merged 10 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: Codecov
on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- '*'

jobs:
run:
runs-on: ${{ matrix.os }}
Expand All @@ -22,7 +29,7 @@ jobs:
pip install -e .[tests]
- name: Generate coverage report
run: |
pytest --cov=./ --cov-report=xml
NUMBA_DISABLE_JIT=1 pytest --cov=./ --cov-report=xml --ignore ./xrspatial/tests/test_polygonize.py
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
Expand Down
22 changes: 14 additions & 8 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
coverage:
status:
patch: off
project:
default:
target: auto
threshold: 1%
status:
patch: off
project:
default:
target: auto
threshold: 0.5%

comment:
require_changes: yes
comment:
require_changes: yes

ignore:
- "xrspatial/tests/test_polygonize.py"
- "xrspatial/experimental/*"
- "xrspatial/gpu_rtx/*"
- "xrspatial/tests/*"
4 changes: 2 additions & 2 deletions xrspatial/convolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np
import xarray as xr
from numba import cuda, float32, jit, prange
from numba import cuda, jit, prange

from xrspatial.utils import (ArrayTypeFunctionMapping, cuda_args, get_dataarray_resolution,
not_implemented_func)
Expand Down Expand Up @@ -294,7 +294,7 @@ def _convolve_2d_numpy(data, kernel):
wkx = nkx // 2
wky = nky // 2

out = np.zeros(data.shape, dtype=float32)
out = np.zeros(data.shape, dtype=np.float32)
out[:] = np.nan
for i in prange(wkx, nx-wkx):
iimin = max(i - wkx, 0)
Expand Down
4 changes: 2 additions & 2 deletions xrspatial/terrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _gen_terrain(height_map, seed, x_range=(0, 1), y_range=(0, 1)):
y_range[0], y_range[1], height, endpoint=False, dtype=np.float32
)
x, y = np.meshgrid(linx, liny)
nrange = np.arange(2**20, dtype=int)
nrange = np.arange(2**20, dtype=np.int32)
for i, (m, (xfreq, yfreq)) in enumerate(NOISE_LAYERS):
np.random.seed(seed+i)
p = np.random.permutation(nrange)
Expand Down Expand Up @@ -93,7 +93,7 @@ def _terrain_dask_numpy(data: da.Array,
)
x, y = da.meshgrid(linx, liny)

nrange = np.arange(2 ** 20, dtype=int)
nrange = np.arange(2 ** 20, dtype=np.int32)

# multiplier, (xfreq, yfreq)
NOISE_LAYERS = ((1 / 2 ** i, (2 ** i, 2 ** i)) for i in range(16))
Expand Down
8 changes: 8 additions & 0 deletions xrspatial/tests/test_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
from xrspatial.tests.general_checks import create_test_raster


def test_summarize_terrain_no_name():
data = np.zeros((10, 20))
test_terrain = create_test_raster(data, name=None)
msg = "Requires xr.DataArray.name property to be set"
with pytest.raises(NameError, match=msg):
summarize_terrain(test_terrain)


@pytest.mark.parametrize("size", [(2, 4), (100, 150)])
@pytest.mark.parametrize(
"dtype", [np.int32, np.int64, np.uint32, np.uint64, np.float32, np.float64]
Expand Down
2 changes: 1 addition & 1 deletion xrspatial/tests/test_zonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def test_apply():
def func(x):
return 0

zones_val = np.zeros((3, 3), dtype=int)
zones_val = np.zeros((3, 3), dtype=np.int32)
# define some zones
zones_val[1] = 1
zones_val[2] = 2
Expand Down