Skip to content

Commit

Permalink
Adding geodataframe to DataConversion (#5325)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Mar 31, 2023
1 parent 0b837fc commit 8b62966
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
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 @@ -13,7 +13,20 @@
from .util import finite_range


class PandasInterface(Interface):
class PandasAPI:
"""
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

0 comments on commit 8b62966

Please sign in to comment.