Skip to content

Commit

Permalink
Fixed flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Nov 3, 2017
1 parent 1f90e20 commit f9896f1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion geoviews/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import param

try:
from . import geopandas
from . import geopandas # noqa (API import)
except ImportError:
pass
except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions geoviews/data/geopandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
from geopandas import GeoDataFrame

from holoviews.core.data import Interface, MultiInterface, PandasInterface
from holoviews.core.data import Interface, MultiInterface
from holoviews.core.data.interface import DataError
from holoviews.core.util import max_range
from holoviews.element import Path
Expand Down Expand Up @@ -40,7 +40,7 @@ def init(cls, eltype, data, kdims, vdims):
@classmethod
def validate(cls, dataset, vdims=True):
dim_types = 'key' if vdims else 'all'
not_found = [d for d in dataset.dimensions(label='name')[2:]
not_found = [d for d in dataset.dimensions(dim_types, label='name')[2:]
if d not in dataset.data.columns]
if not_found:
raise DataError("Supplied data does not contain specified "
Expand Down
3 changes: 0 additions & 3 deletions geoviews/element/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
RGB as HvRGB, Contours as HvContours)

from shapely.geometry.base import BaseGeometry
from shapely.geometry import (MultiLineString, LineString,
MultiPolygon, Polygon)

try:
from iris.cube import Cube
Expand All @@ -29,7 +27,6 @@
except:
WebMapTileService = None

from ..data.geopandas import GeoPandasInterface
from ..util import path_to_geom, polygon_to_geom

geographic_types = (cGoogleTiles, cFeature, BaseGeometry)
Expand Down
3 changes: 1 addition & 2 deletions geoviews/plotting/bokeh/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import copy
import itertools

import param
import numpy as np
import shapely.geometry
from cartopy.crs import GOOGLE_MERCATOR
from bokeh.models import WMTSTileSource, MercatorTickFormatter, MercatorTicker
from bokeh.models.tools import BoxZoomTool, HoverTool
from bokeh.models.tools import BoxZoomTool

from holoviews import Store, Overlay, NdOverlay
from holoviews.core import util
Expand Down
3 changes: 2 additions & 1 deletion geoviews/plotting/mpl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from ...element import (Image, Points, Feature, WMTS, Tiles, Text,
LineContours, FilledContours, is_geographic,
Path, Polygons, Shape, RGB, Contours)
from ...util import path_to_geom, polygon_to_geom, project_extents, geo_mesh
from ...util import project_extents, geo_mesh

from ...operation import project_points, project_path

Expand Down Expand Up @@ -192,6 +192,7 @@ class LineContourPlot(GeoPlot, ColorbarPlot):

def get_data(self, element, ranges, style):
args = geo_mesh(element)
style.pop('label', None)
if isinstance(self.levels, int):
args += (self.levels,)
else:
Expand Down
10 changes: 4 additions & 6 deletions geoviews/util.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import numpy as np
from cartopy import crs as ccrs
from shapely.geometry import (MultiLineString, LineString,
MultiPolygon, Polygon, asLineString,
asPolygon)
from shapely.geometry import (MultiLineString, LineString, MultiPolygon, Polygon)

#from .element import RGB


def wrap_lons(lons, base, period):
Expand Down Expand Up @@ -126,10 +123,11 @@ def geo_mesh(element):
on a cylindrical coordinate system and wraps globally that data
actually wraps around.
"""
if isinstance(element, RGB):
if len(element.vdims) > 1:
xs, ys = (element.dimension_values(i, False, False)
for i in range(2))
zs = np.dstack([element.dimension_values(i, False, False) for i in range(2, 2+len(element.vdims))])
zs = np.dstack([element.dimension_values(i, False, False)
for i in range(2, 2+len(element.vdims))])
else:
xs, ys, zs = (element.dimension_values(i, False, False)
for i in range(3))
Expand Down

0 comments on commit f9896f1

Please sign in to comment.