Fix to/from-file without events and resample corner cases#73
Fix to/from-file without events and resample corner cases#73
Conversation
94e14c2 to
479f14a
Compare
…e. override include_output if implemention is missing in resample
… into handle-no-implementation
| new_t = t_grid | ||
| new_x = np.empty((t_grid.size, self._res.x.shape[1]), float) | ||
| for seg in interp: | ||
| i_to_samp = np.nonzero((t_grid >= seg.t0) & (t_grid <= seg.t1)) |
There was a problem hiding this comment.
I was worried you would have an issue using >= and <= if there is an event on the grid. But it seems like you have test coverage for it -- do you know which side of the event it takes?
There was a problem hiding this comment.
Nice, that's a subtlety I hadn't thought through. It comes from t+ because the one matching <= from a previous segment is overwritten by the match with >= on the next segment. Perhaps it should be >= & < to be more explicit (and slightly more efficient I guess). The tf event would then need special handling, but that's not a big deal. This was my test rig (the sample at 0.3 does not coincide exactly with the event, but the one at 0.5 does, yay floating point)
There was a problem hiding this comment.
Made the switch to >= & < for aesthetics and added a test.
There was a problem hiding this comment.
While you're here, would it make sense to handle re-sampling if there is no implementation?
Fixes #70, #71, #72