Skip to content
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

Add compatibility for Dask 2021.06.0 #70

Merged
merged 15 commits into from
Jun 9, 2021
15 changes: 5 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
python-version: 3.6
- os: macos-latest
python-version: 3.8
timeout-minutes: 40
timeout-minutes: 60
defaults:
run:
shell: bash -l {0}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
CHANS_DEV: "-c pyviz/label/dev"
CHANS_DEV: "-c pyviz/label/dev -c conda-forge"
CHANS_OSX: "-c pyviz/label/dev -c conda-forge"
CHANS: "-c pyviz"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -42,6 +42,9 @@ jobs:
- uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
channel-priority: strict
activate-environment: test-environment
philippjfr marked this conversation as resolved.
Show resolved Hide resolved
- name: Fetch
run: git fetch --prune --tags
- name: conda setup
Expand All @@ -50,15 +53,7 @@ jobs:
conda install -c pyviz "pyctdev>=0.5"
doit ecosystem_setup
doit env_create ${{ env.CHANS_DEV}} --python=${{ matrix.python-version }}
- name: doit develop_install osx
if: contains(matrix.os, 'macos')
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
doit develop_install ${{ env.CHANS_OSX }} -o tests
pip install hilbertcurve
- name: doit develop_install
if: (!contains(matrix.os, 'macos'))
run: |
eval "$(conda shell.bash hook)"
conda activate test-environment
Expand Down
23 changes: 5 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import sys

import param

from setuptools import find_packages, setup

extras_require = {
Expand Down Expand Up @@ -29,27 +28,15 @@
install_requires = [
'fsspec',
'numba',
'pandas>=0.25',
'pandas >=0.25',
'param',
'pyarrow>=0.15',
'pyarrow >=1.0',
'python-snappy',
'retrying',
'numpy',
'dask[complete] >=2.0'
]

# Checking for platform explicitly because
# pyctdev does not handle dependency conditions
# such as 'numpy<1.20;platform_system=="Darwin"'
if sys.platform == 'darwin':
install_requires.extend([
'dask[complete]>=2.0,<2020.12',
'numpy<1.20',
])
else:
install_requires.extend([
'dask[complete]>=2.0',
'numpy',
])

setup_args = dict(
name='spatialpandas',
version=param.version.get_setup_version(
Expand Down
11 changes: 8 additions & 3 deletions spatialpandas/dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
from dask import delayed
from dask.dataframe.core import get_parallel_type
from dask.dataframe.partitionquantiles import partition_quantiles
from dask.dataframe.utils import make_array_nonempty, make_meta, meta_nonempty
from dask.dataframe.extensions import make_array_nonempty
try:
from dask.dataframe.dispatch import make_meta_dispatch
from dask.dataframe.backends import meta_nonempty
except ImportError:
from dask.dataframe.utils import make_meta as make_meta_dispatch, meta_nonempty

from .geodataframe import GeoDataFrame
from .geometry.base import GeometryDtype, _BaseCoordinateIndexer
Expand Down Expand Up @@ -99,7 +104,7 @@ def persist(self, **kwargs):
)


@make_meta.register(GeoSeries)
@make_meta_dispatch.register(GeoSeries)
def make_meta_series(s, index=None):
result = s.head(0)
if index is not None:
Expand Down Expand Up @@ -546,7 +551,7 @@ def __getitem__(self, key):
return result


@make_meta.register(GeoDataFrame)
@make_meta_dispatch.register(GeoDataFrame)
def make_meta_dataframe(df, index=None):
result = df.head(0)
if index is not None:
Expand Down