diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7801301b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* \ No newline at end of file diff --git a/ost/generic/ts_ls_mask.py b/ost/generic/ts_ls_mask.py index fbc8ebb1..7f7ee001 100644 --- a/ost/generic/ts_ls_mask.py +++ b/ost/generic/ts_ls_mask.py @@ -52,8 +52,9 @@ def mt_layover(list_of_ls): df2 = gpd.read_file(file) df2 = df2[~(df2.geometry.is_empty | df2.geometry.isna())] - geom2 = df2.geometry.buffer(0).unary_union - geom = unary_union([geom, geom2]) + if not df2.empty: + geom2 = df2.geometry.buffer(0).unary_union + geom = unary_union([geom, geom2]) if y > 0: # make geometry valid in case it isn't diff --git a/setup.py b/setup.py index 1e48c0da..a1e7147d 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ name='opensartoolkit', packages=find_packages(), include_package_data=True, - version='0.12.4', + version='0.12.5', description='High-level functionality for the inventory, download ' 'and pre-processing of Sentinel-1 data', install_requires=[