slac207 / cs207project

MIT License
0 stars 4 forks source link

Generalize the ArrayTimeSeries class to take sequences instead of numpy.array #5

Closed sanoke closed 7 years ago

sanoke commented 7 years ago

Task (from Project Spec 3) Please change the class constructor to take two sequences as input. The call signature should look something like this now:

# order of arguments has changed because no default
def __init__(self, times, values): # notice no default for times now
  ...

Make sure you implement the __iter__, itertimes, iteritems, __len__, __getitem__ and __setitem__ (the latter two take an index and get a value and set a value correspoinding to that index respectively..note I say index, not time).


Details Rewrite your ArrayTimeSeries class, with two goals:

The goal of your new arrays is to work something like a cross between an array and a dictionary. Your class is an ordered container, where each time point should be monotonically increasing (you don't need to enforce this right now, but you're welcome to if you want). It's like a sequence or array in this way.

brennan-ae commented 7 years ago

@cocochrane @lshen2009 Is this closed now?