Skip to content

Commit

Permalink
Address moved import of Iterable (#4252)
Browse files Browse the repository at this point in the history
* Address moved import of Iterable

* Fixed flakes
  • Loading branch information
philippjfr committed Mar 3, 2020
1 parent 81108e9 commit dff5b09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 3 additions & 2 deletions holoviews/core/data/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import sys
import datetime as dt
from collections import OrderedDict, defaultdict, Iterable

from collections import OrderedDict, defaultdict

try:
import itertools.izip as zip
Expand Down Expand Up @@ -374,7 +375,7 @@ def invert_index(cls, index, length):
if stop is not None:
new_start = length - stop
return slice(new_start-1, new_stop-1)
elif isinstance(index, Iterable):
elif isinstance(index, util.Iterable):
new_index = []
for ind in index:
new_index.append(length-ind)
Expand Down
6 changes: 6 additions & 0 deletions holoviews/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
if sys.version_info.major >= 3:
import builtins as builtins # noqa (compatibility)

if sys.version_info.minor > 3:
from collections.abc import Iterable # noqa (compatibility)
else:
from collections import Iterable # noqa (compatibility)

basestring = str
unicode = str
long = int
Expand All @@ -39,6 +44,7 @@
LooseVersion = _LooseVersion
else:
import __builtin__ as builtins # noqa (compatibility)
from collections import Iterable # noqa (compatibility)

basestring = basestring
unicode = unicode
Expand Down
4 changes: 2 additions & 2 deletions holoviews/operation/datashader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import absolute_import, division

from collections import Callable, Iterable
from collections import Callable
import warnings

import param
Expand All @@ -24,7 +24,7 @@
CompositeOverlay, Dataset, Overlay, OrderedDict)
from ..core.data import PandasInterface, XArrayInterface, DaskInterface
from ..core.util import (
LooseVersion, basestring, cftime_types, cftime_to_timestamp,
Iterable, LooseVersion, basestring, cftime_types, cftime_to_timestamp,
datetime_types, dt_to_int, isfinite, get_param_values, max_range)
from ..element import (Image, Path, Curve, RGB, Graph, TriMesh,
QuadMesh, Contours, Spikes, Area, Spread,
Expand Down

0 comments on commit dff5b09

Please sign in to comment.