Skip to content

Commit

Permalink
Fix shape and length reporting of gridded interfaces for Python 3.6 o…
Browse files Browse the repository at this point in the history
…n Win 64 (#2903)
  • Loading branch information
ceball authored and philippjfr committed Aug 4, 2018
1 parent b3cbaad commit aab5c8a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion holoviews/core/data/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def shape(cls, dataset, gridded=False):
if gridded:
return shape
else:
return (np.product(shape), len(dataset.dimensions()))
return (np.product(shape, dtype=np.intp), len(dataset.dimensions()))


@classmethod
Expand Down
2 changes: 1 addition & 1 deletion holoviews/core/data/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def shape(cls, dataset, gridded=False):

@classmethod
def length(cls, dataset):
return np.product(dataset.data.shape[:2])
return np.product(dataset.data.shape[:2], dtype=np.intp)


@classmethod
Expand Down
2 changes: 1 addition & 1 deletion holoviews/core/data/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def length(cls, dataset):
"""
Returns the total number of samples in the dataset.
"""
return np.product([len(d.points) for d in dataset.data.coords(dim_coords=True)])
return np.product([len(d.points) for d in dataset.data.coords(dim_coords=True)], dtype=np.intp)


@classmethod
Expand Down
4 changes: 2 additions & 2 deletions holoviews/core/data/xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def shape(cls, dataset, gridded=False):
if gridded:
return shape
else:
return (np.product(shape), len(dataset.dimensions()))
return (np.product(shape, dtype=np.intp), len(dataset.dimensions()))


@classmethod
Expand Down Expand Up @@ -443,7 +443,7 @@ def select(cls, dataset, selection_mask=None, **selection):

@classmethod
def length(cls, dataset):
return np.product([len(dataset.data[d.name]) for d in dataset.kdims])
return np.product([len(dataset.data[d.name]) for d in dataset.kdims], dtype=np.intp)

@classmethod
def dframe(cls, dataset, dimensions):
Expand Down

0 comments on commit aab5c8a

Please sign in to comment.