chaco.array_data_source module

Defines the ArrayDataSource class.

class chaco.array_data_source.ArrayDataSource(data=array([], dtype=float64), sort_order='none', **kw)

Bases: chaco.abstract_data_source.AbstractDataSource

A data source representing a single, continuous array of numerical data.

This class does not listen to the array for value changes; if you need that behavior, create a subclass that hooks up the appropriate listeners.


Returns the minimum and maximum values of the data source’s data.

Implements AbstractDataSource.


Returns the data for this data source, or 0.0 if it has no data.

Implements AbstractDataSource.


Implements AbstractDataSource.


Implements AbstractDataSource.

index_dimension = Constant("scalar")

The dimensionality of the indices into this data source (overrides AbstractDataSource).


Implements AbstractDataSource.


Removes the mask on this data source.

reverse_map(pt, index=0, outside_returns_none=True)

Returns the index of pt in the data source.

  • pt (scalar value) – value to find

  • index – ignored for data series with 1-D indices

  • outside_returns_none (Boolean) – Whether the method returns None if pt is outside the range of the data source; if False, the method returns the value of the bound that pt is outside of.

set_data(newdata, sort_order=None)

Sets the data, and optionally the sort order, for this data source.

  • newdata (array) – The data to use.

  • sort_order (SortOrderTrait) – The sort order of the data


Sets the mask for this data source.

sort_order = SortOrderTrait

The sort order of the data. This is a specialized optimization for 1-D arrays, but it’s an important one that’s used everywhere.

value_dimension = Constant("scalar")

The dimensionality of the value at each index point (overrides AbstractDataSource).


Find the index of the maximum value, ignoring NaNs.

If all NaNs, return -1.


Find the index of the minimum value, ignoring NaNs.

If all NaNs, return 0.