slac207 / cs207project

MIT License
0 stars 3 forks source link

Add more methods to the TimeSeries class #22

Closed sanoke closed 8 years ago

sanoke commented 8 years ago

From Project Spec 4, implement the following new functions:

  1. __contains__: is a value in the values
  2. itervalues: returns an iterator over them
  3. times: returns a numpy array of times
  4. items: returns a list of time-value tuple pairs

Also, make sure that the following functions are implemented as described:

  1. __getitem__: to get a value for a given index
  2. __setitem__: set the value for the given index
  3. __iter__: iterates over values. (This might have iterated over tuples of (time, value) pairs earlier)
  4. values: returns a numpy array of values
  5. itertimes: returns an iterator over them
  6. iteritems: returns an iterator over these
  7. __len__: returns a length
  8. __repr__: abbreviating string representation
jsm09 commented 8 years ago

I'm going to also add "values" because I don't think we have that.

jsm09 commented 8 years ago

Just completed. OK to close? @sanoke