diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index bdbd3cad..9b53c8ab 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python: [3.9] + python: [3.12] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} @@ -31,8 +31,9 @@ jobs: run: | 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 + uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} env_vars: OS,PYTHON fail_ci_if_error: true verbose: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a027b8d..14977c39 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python: [3.8, 3.9, '3.10', 3.11] + python: ['3.10', 3.11, 3.12] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} diff --git a/README.md b/README.md index aecb5a2a..efe2114a 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,8 @@ Downloads
- PyPI downloads per month -
@@ -123,9 +121,6 @@ In all the above, the command will download and store the files into your curren `xarray-spatial` does not depend on GDAL / GEOS, which makes it fully extensible in Python but does limit the breadth of operations that can be covered. xarray-spatial is meant to include the core raster-analysis functions needed for GIS developers / analysts, implemented independently of the non-Python geo stack. -Our documentation is still under construction, but [docs can be found here](https://xarray-spatial.org/). - - #### Raster-huh? Rasters are regularly gridded datasets like GeoTIFFs, JPGs, and PNGs. @@ -283,4 +278,4 @@ With the introduction of projects like Numba, Python gained new ways to provide #### Citation Cite our code: -`makepath/xarray-spatial, https://github.com/makepath/xarray-spatial, ©2020-2023.` +`makepath/xarray-spatial, https://github.com/makepath/xarray-spatial, ©2020-2024.` diff --git a/requirements.txt b/requirements.txt index ed5544aa..d5ea9d1c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ datashader +dask[dataframe] noise >=1.2.2 numba xarray diff --git a/xrspatial/experimental/polygonize.py b/xrspatial/experimental/polygonize.py index f16ec466..992fc2bd 100644 --- a/xrspatial/experimental/polygonize.py +++ b/xrspatial/experimental/polygonize.py @@ -39,6 +39,33 @@ _visited_dtype = np.uint8 +def generated_jit(function=None, cache=False, + pipeline_class=None, **options): + """ + This decorator allows flexible type-based compilation + of a jitted function. It works as `@jit`, except that the decorated + function is called at compile-time with the *types* of the arguments + and should return an implementation function for those types. + """ + from numba.extending import overload + jit_options = dict() + if pipeline_class is not None: + jit_options['pipeline_class'] = pipeline_class + jit_options['cache'] = cache + jit_options |= options + + if function is not None: + overload(function, jit_options=jit_options, + strict=False)(function) + return function + else: + def wrapper(func): + overload(func, jit_options=jit_options, + strict=False)(func) + return func + return wrapper + + class Turn(Enum): Left = -1 Straight = 0 @@ -183,7 +210,7 @@ def _follow( # Generator of numba-compatible comparison functions for values. # If both values are integers use a fast equality operator, otherwise use a # slower floating-point comparison like numpy.isclose. -@nb.generated_jit(nogil=True, nopython=True) +@generated_jit(nogil=True, nopython=True) def _is_close( reference: Union[int, float], value: Union[int, float],