Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions chaco/array_data_source.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" Defines the ArrayDataSource class."""

# Major library imports
from numpy import array, isfinite, ones, ndarray
from numpy import array, empty, isfinite, ones, ndarray
import numpy as np

# Enthought library imports
Expand Down Expand Up @@ -147,7 +147,7 @@ def get_data(self):
if self._data is not None:
return self._data
else:
return 0.0
return empty(shape=(0,))

def get_data_mask(self):
"""get_data_mask() -> (data_array, mask_array)
Expand Down Expand Up @@ -238,17 +238,10 @@ def _compute_bounds(self, data=None):
# version of the dataset?

if data is None:
# Several sources weren't setting the _data attribute, so we
# go through the interface. This seems like the correct thing
# to do anyway... right?
# data = self._data
data = self.get_data()

data_len = 0
try:
data_len = len(data)
except Exception:
pass
data_len = len(data)

if data_len == 0:
self._min_index = 0
self._max_index = 0
Expand Down