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

« back to all changes in this revision

Viewing changes to chaco/abstract_plot_data.py

  • Committer: Package Import Robot
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2014-06-01 17:04:08 UTC
  • mfrom: (7.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20140601170408-m86xvdjd83a4qon0
Tags: 4.4.1-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
 - Let the binary-predeb target work on the usr/lib/python* directory
   as we don't have usr/share/pyshared anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
        raise NotImplementedError
50
50
 
51
51
 
 
52
    def del_data(self, name):
 
53
        """ Deletes the array specified by *name*, or raises a KeyError if
 
54
        the named array does not exist.
 
55
        
 
56
        If the instance is not writable, then this must do nothing.
 
57
        
 
58
        """
 
59
        raise NotImplementedError
 
60
 
52
61
    def set_data(self, name, new_data, generate_name=False):
53
 
        """
54
 
        Returns the new data's name.
55
 
 
56
 
        If **writable** is True, then this method sets the data associated
57
 
        with the given name to the new value.
58
 
 
59
 
        If **writable** is False, then this method must do nothing.
60
 
 
61
 
        If *generate_name* is True, then the data source must
62
 
        create a new name to bind to the data, and return it.
63
 
 
64
 
        If the name does not exist, then the method attaches a new data entry
65
 
        to this PlotData.
66
 
 
67
 
        """
68
 
        raise NotImplementedError
69
 
 
 
62
        """ Sets the specified array as the value for either the specified
 
63
        name or a generated name.
 
64
 
 
65
        If the instance's `writable` attribute is True, then this method sets
 
66
        the data associated with the given name to the new value, otherwise it
 
67
        does nothing.
 
68
 
 
69
        Parameters
 
70
        ----------
 
71
        name : string
 
72
            The name of the array whose value is to be set.
 
73
        new_data : array
 
74
            The array to set as the value of *name*.
 
75
        generate_name : Boolean
 
76
            If True, a unique name of the form 'seriesN' is created for the
 
77
            array, and is used in place of *name*. The 'N' in 'seriesN' is
 
78
            one greater the largest N already used.
 
79
 
 
80
        Returns
 
81
        -------
 
82
        The name under which the array was set.
 
83
 
 
84
        """
 
85
        raise NotImplementedError
 
86
 
 
87
 
 
88
    def update_data(self, *args, **kwargs):
 
89
        """
 
90
        Update a set of data values, firing only one data_changed event.
 
91
        
 
92
        This function has the same signature as the dictionary update()
 
93
        method.
 
94
        
 
95
        """
 
96
        raise NotImplementedError
70
97
 
71
98
    def set_selection(self, name, selection):
72
99
        """ Sets the selection on the specified data.
83
110
            array named by *name* is selected.
84
111
        """
85
112
        raise NotImplementedError
 
113
 
 
114
    #------------------------------------------------------------------------
 
115
    # Dictionary Interface
 
116
    #------------------------------------------------------------------------
 
117
 
 
118
    def __getitem__(self, name):
 
119
        return self.arrays.get(name, None)
 
120
 
 
121
    def __setitem__(self, name, value):
 
122
        return self.set_data(name, value)
 
123
 
 
124
    def __delitem__(self, name):
 
125
        return self.del_data(name)
 
126
 
 
127
    def update(self, *args, **kwargs):
 
128
        self.update_data(*args, **kwargs)
 
129