A time-indexed array that can only handle equally spaced times.
This implements an array-like object that uses time as an index. It recognizes only discrete times as specified by a start, an end and a timestep. The end is only used as a guideline: if it does not lie exactly on a timestep, the next timestep end is used. Note that all methods in this class have the same meaning as the built-in list class, but accept times as input, except if specified otherwise. In all cases, the time "index" is anything accepted by to_datetime_rel(...,self.start).
Definition at line 689 of file numerics.py.
|
| def | __init__ |
| | TimeArray constructor. More...
|
| |
| def | index_of (self, when) |
| | Returns the index of the specified time in the internal storage arrays or raises NotInTimespan if the time is not in the timespan. More...
|
| |
| def | __init__ |
| | TimeContainer constructor. More...
|
| |
| def | at_index (self, index) |
| | Returns the data at the given index, or raises KeyError if no data exists. More...
|
| |
| def | index_of (self, when) |
| | This virtual function should be implemented in a subclass. More...
|
| |
| def | lasttime (self) |
| | Returns the last time in the array or list of times, even if it has no data. More...
|
| |
| def | firsttime (self) |
| | Returns the first time in the array or list of times, even if it has no data. More...
|
| |
| def | __getitem__ (self, when) |
| | Returns the item at the latest time that is not later than "when". More...
|
| |
| def | neartime |
| | Returns a tuple containing the time nearest to "when" without going over, and the index of that time. More...
|
| |
| def | get (self, when, default) |
| | Returns the item at the latest time that is not later than "when.". More...
|
| |
| def | __setitem__ (self, when, val) |
| | Finds the latest time that is not later than "when" in self._times. More...
|
| |
| def | __iter__ (self) |
| | Iterates over all data. More...
|
| |
| def | itervalues (self) |
| | Iterates over data for all known times that have data. More...
|
| |
| def | iterkeys (self) |
| | Iterates over all times that have data. More...
|
| |
| def | iteritems (self) |
| | Iterates over all known times that have data, returning a tuple containing the time and the data at that time. More...
|
| |
| def | __reversed__ (self) |
| | Iterates over all known times that have data, in reverse order. More...
|
| |
| def | __delitem__ (self, when) |
| | Finds the latest time that is not later than "when" and removes the data it is mapped to. More...
|
| |
| def | __contains__ (self, when) |
| | Finds the latest time that is not later than "when" in self._times. More...
|
| |
| def | __len__ (self) |
| | Returns the number of times that have data. More...
|
| |
|
def | times (self) |
| | Iterates over all times in this TimeContainer.
|
| |
| def | datatimes (self) |
| | Iterates over all times in this TimeContainer that map to data. More...
|
| |
| def | __str__ (self) |
| | Returns a string representation of this object. More...
|
| |
| def | datatimes_reversed (self) |
| | Iterates in reverse order over all times in this TimeContainer that map to data. More...
|
| |