Skip to content

Commit

Permalink
Merge pull request #818 from ioam/iris_default_dims
Browse files Browse the repository at this point in the history
Ensure that iris does not override supplied dimensions
  • Loading branch information
jlstevens committed Aug 17, 2016
2 parents fa43fa1 + 55dbf66 commit fa5e503
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions holoviews/core/data/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

from .interface import Interface
from .grid import GridInterface
from ..dimension import Dimension
from ..ndmapping import (NdMapping, item_check, sorted_context)
from ..spaces import HoloMap
from .. import util

from holoviews.core.dimension import Dimension


def get_date_format(coord):
Expand Down Expand Up @@ -102,11 +102,12 @@ def init(cls, eltype, data, kdims, vdims):
if len(coord) == 0:
raise ValueError('Key dimension %s not found in '
'Iris cube.' % kd)
coords.append(coord[0])
coords.append(kd if isinstance(kd, Dimension) else coord[0])
else:
coords = data.dim_coords
coords = sorted(coords, key=sort_coords)
kdims = [coord_to_dimension(crd) for crd in coords]
kdims = [crd if isinstance(crd, Dimension) else coord_to_dimension(crd)
for crd in coords]
if vdims is None:
vdims = [Dimension(data.name(), unit=str(data.units))]

Expand Down

0 comments on commit fa5e503

Please sign in to comment.