Skip to content

Commit 950ca44

Browse files
authored
Bunch of CI/CD-related fixes (#796)
* updated year in citation * removed links to old docs site * added dask dataframe to requirements as test * added unstable fix for polygonize generated_jit * added py312 and dropped 3.8 and 3.9 * changed 3.10 back to string * updated codecov.yml * updated codecov.yml * if stat upload fails, still pass test * added code coverage token
1 parent 27ab0c8 commit 950ca44

File tree

5 files changed

+34
-10
lines changed

5 files changed

+34
-10
lines changed

.github/workflows/codecov.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest]
16-
python: [3.9]
16+
python: [3.12]
1717
env:
1818
OS: ${{ matrix.os }}
1919
PYTHON: ${{ matrix.python }}
@@ -31,8 +31,9 @@ jobs:
3131
run: |
3232
NUMBA_DISABLE_JIT=1 pytest --cov=./ --cov-report=xml --ignore ./xrspatial/tests/test_polygonize.py
3333
- name: Upload coverage to Codecov
34-
uses: codecov/codecov-action@v2
34+
uses: codecov/codecov-action@v3
3535
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}
3637
env_vars: OS,PYTHON
3738
fail_ci_if_error: true
3839
verbose: true

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
16-
python: [3.8, 3.9, '3.10', 3.11]
16+
python: ['3.10', 3.11, 3.12]
1717
env:
1818
OS: ${{ matrix.os }}
1919
PYTHON: ${{ matrix.python }}

README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
<td>Downloads</td>
1414
<td>
1515
<div>
16-
<a href="https://xarray-spatial.org/getting_started/installation.html">
1716
<img src="https://img.shields.io/pypi/dm/xarray-spatial?label=PyPI"
1817
alt="PyPI downloads per month" />
19-
</a>
2018
</div>
2119
</td>
2220
</tr>
@@ -123,9 +121,6 @@ In all the above, the command will download and store the files into your curren
123121
`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.
124122

125123

126-
Our documentation is still under construction, but [docs can be found here](https://xarray-spatial.org/).
127-
128-
129124
#### Raster-huh?
130125

131126
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
283278
#### Citation
284279
Cite our code:
285280

286-
`makepath/xarray-spatial, https://github.com/makepath/xarray-spatial, ©2020-2023.`
281+
`makepath/xarray-spatial, https://github.com/makepath/xarray-spatial, ©2020-2024.`

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
datashader
2+
dask[dataframe]
23
noise >=1.2.2
34
numba
45
xarray

xrspatial/experimental/polygonize.py

+28-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,33 @@
3939
_visited_dtype = np.uint8
4040

4141

42+
def generated_jit(function=None, cache=False,
43+
pipeline_class=None, **options):
44+
"""
45+
This decorator allows flexible type-based compilation
46+
of a jitted function. It works as `@jit`, except that the decorated
47+
function is called at compile-time with the *types* of the arguments
48+
and should return an implementation function for those types.
49+
"""
50+
from numba.extending import overload
51+
jit_options = dict()
52+
if pipeline_class is not None:
53+
jit_options['pipeline_class'] = pipeline_class
54+
jit_options['cache'] = cache
55+
jit_options |= options
56+
57+
if function is not None:
58+
overload(function, jit_options=jit_options,
59+
strict=False)(function)
60+
return function
61+
else:
62+
def wrapper(func):
63+
overload(func, jit_options=jit_options,
64+
strict=False)(func)
65+
return func
66+
return wrapper
67+
68+
4269
class Turn(Enum):
4370
Left = -1
4471
Straight = 0
@@ -183,7 +210,7 @@ def _follow(
183210
# Generator of numba-compatible comparison functions for values.
184211
# If both values are integers use a fast equality operator, otherwise use a
185212
# slower floating-point comparison like numpy.isclose.
186-
@nb.generated_jit(nogil=True, nopython=True)
213+
@generated_jit(nogil=True, nopython=True)
187214
def _is_close(
188215
reference: Union[int, float],
189216
value: Union[int, float],

0 commit comments

Comments
 (0)