~ubuntu-branches/ubuntu/utopic/python-chaco/utopic

« back to all changes in this revision

Viewing changes to enthought/chaco/attic/advanced_datamodel/dataseries.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-04-06 19:03:54 UTC
  • mfrom: (7.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110406190354-rwd55l2ezjecfo41
Tags: 3.4.0-2
d/rules: fix pyshared directory path (Closes: #621116)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""
2
 
DataSeries are the most fundamental encapsulation of numerical data in Chaco.
3
 
They implement the DataSource interface and have a name and a dimension.
4
 
 
5
 
The best way to adapt external domain objects for Chaco is to make them
6
 
subclass AbstractDataSeries.  (An alternate approach is to make them produce
7
 
instances of a DataSeries subclass of the appropriate dimension.)
8
 
"""
9
 
 
10
 
from enthought.traits.api import Enum, Event, Instance
11
 
 
12
 
from datasource import DataSource
13
 
 
14
 
class AbstractDataSeries(DataSource):
15
 
    """
16
 
    Base class for all DataSeries.  Fleshes out some of the basic common
17
 
    functionality of DataSources when applied to numerical arrays.
18
 
    """
19
 
    # Re-declare the "parent" trait (inherited from DataSource) to indicate
20
 
    # that DataSeries are the start of the data pipeline.
21
 
    parent = None
22
 
    
23
 
    # Add some additional metadata that all DataSeries should have.
24
 
    metadata = Instance(dict, {"selections":[], "annotations":[]})
25
 
 
26
 
    def get_view(self):
27
 
        # If the upwards-propagating get_view() call has reached us, then there
28
 
        # were no ViewFilters downstream of us.  This method should do the right
29
 
        # thing for all standard, numerical DataSeries subclasses.
30
 
        return None
31
 
 
32
 
    
33
 
#EOF