Closed hunt0r closed 5 years ago
Since it's still fresh for you, can you remind me why it should be an error?
Oh, I see now. I think it should error out. Since the API says type first and then interval, we should respect it. If we ever add unit tests (in a parallel universe) it would be hard to catch such a case. Plus, it's always hard to guess the intention of the user.
Upon further inspection, I see that the correct call is:
function slice = getSlice(obj, slice_values, slice_type)
Did you make a typo when you wrote
getSlice([val1 val2], 'TimeS')
in the first post?
Yeah, that was a typo, sorry.
Anyways, I'm happy to just have it throw an error instead. I'll close the request and issue a different one with the error message.
I accidentally called getSlice([val1 val2], 'TimeS') and was surprised when no error occurred, but also no data was sliced. This elegantly fixes that easy mistake for the user... if you like it. If you'd prefer the software simply returns an error when the user makes a mistake, rather than doing what was meant, that's also fine with me.