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

Adding geodataframe to DataConversion #5325

Merged
merged 5 commits into from
Mar 31, 2023
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
4 changes: 2 additions & 2 deletions holoviews/core/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from .interface import Interface, iloc, ndloc
from .multipath import MultiInterface # noqa (API import)
from .image import ImageInterface # noqa (API import)
from .pandas import PandasInterface
from .pandas import PandasAPI, PandasInterface # noqa (API import)
from .spatialpandas import SpatialPandasInterface # noqa (API import)
from .spatialpandas_dask import DaskSpatialPandasInterface # noqa (API import)
from .xarray import XArrayInterface # noqa (API import)
Expand Down Expand Up @@ -124,7 +124,7 @@ def __call__(self, new_type, kdims=None, vdims=None, groupby=None,
else:
selected = self._element
else:
if issubclass(self._element.interface, PandasInterface):
if issubclass(self._element.interface, PandasAPI):
ds_dims = self._element.dimensions()
ds_kdims = [self._element.get_dimension(d) if d in ds_dims else d
for d in groupby+kdims]
Expand Down
15 changes: 14 additions & 1 deletion holoviews/core/data/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@
from .util import finite_range


class PandasInterface(Interface):
class PandasAPI:
"""
hoxbro marked this conversation as resolved.
Show resolved Hide resolved
This class is used to describe the interface as having a pandas-like API.

The reason to have this class is that it is not always
possible to directly inherit from the PandasInterface.

This class should not have any logic as it should be used like:
if issubclass(interface, PandasAPI):
...
"""


class PandasInterface(Interface, PandasAPI):

types = (pd.DataFrame,)

Expand Down