Skip to content

Commit

Permalink
Fix Image element bounds check
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Oct 7, 2019
1 parent 63551b1 commit a7f820f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion holoviews/element/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,9 @@ def __init__(self, data, kdims=None, vdims=None, bounds=None, extents=None,
bounds = BoundingBox(points=((l, b), (r, t)))

data_bounds = None
if self.interface is ImageInterface and not isinstance(data, np.ndarray):
if self.interface is ImageInterface and not bounds:
data_bounds = self.bounds.lbrt()

l, b, r, t = bounds.lbrt()
xdensity = xdensity if xdensity else util.compute_density(l, r, dim1, self._time_unit)
ydensity = ydensity if ydensity else util.compute_density(b, t, dim2, self._time_unit)
Expand Down Expand Up @@ -389,6 +390,7 @@ def _validate(self, data_bounds, supplied_bounds):
c = util.dt_to_int(c)
if util.isfinite(r) and not np.isclose(r, c, rtol=self.rtol):
not_close = True
print(r, c, r-c)
if not_close:
raise ValueError('Supplied Image bounds do not match the coordinates defined '
'in the data. Bounds only have to be declared if no coordinates '
Expand Down

0 comments on commit a7f820f

Please sign in to comment.