slac207 / cs207project

MIT License
0 stars 4 forks source link

TimeSeries constructor #35

Closed cocochrane closed 8 years ago

cocochrane commented 8 years ago

Do you all think that times and values need to be the same length? Say if the user inputs times = [0,1,2] and values = [1,2,3,4,5,6,7], then should our program return that this is invalid?

Also should there be conditions on the times values- for instance should each time need to be distinct?

Let me know what you think! @sanoke @jsm09 @brennan-ae

jsm09 commented 8 years ago

Good questions...should we ask on Piazza? I feel like they should probably be the same length. We don't want to have to overly check the input, but it doesn't really make sense to have values without times. The second one feels like it should maybe be up to the user to pass in something that makes sense, but I'm not 100% sure.

cocochrane commented 8 years ago

I will post asking on piazza!

brennan-ae commented 8 years ago

I think they need to be the same length. If not, the user messed something up and they should know about it. It would be good if we could fail gracefully/informatively. I don't know if that's explicit checking or something else. I'd probably lean toward explicit checking.

I first thought having repeated times should be okay, but the more I thought about it the more I though it would be a problem. For example, how should the interpolate method handle it -- if you're looking between times t and t+1, but there are two entries with time t, should it average them? Then it's a noisy interpolation (i.e. the interpolating line doesn't go through all the data since it split the difference at t). Is that what we want? Or we could just use the "last" time t value -- this is probably what the code would do if we didn't change anything.

So we could just assume that there are distinct times and say it in the contract at the beginning but not enforce it, or we could enforce it. Not sure what's better.