From b924099731f15e52444f3f3981bd7a099216e07d Mon Sep 17 00:00:00 2001 From: Alejandro de la Vega Date: Wed, 9 Nov 2022 15:03:02 -0600 Subject: [PATCH] Add onset to results --- pliers/extractors/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pliers/extractors/models.py b/pliers/extractors/models.py index 272166f2..ed7cb7a2 100644 --- a/pliers/extractors/models.py +++ b/pliers/extractors/models.py @@ -110,7 +110,8 @@ def _get_timing(self, out, stim): durations: durations of the output orders: order of the output """ - return None, None, None + + return stim.onset, stim.duration, None def _extract(self, stim): inp = self._preprocess(stim) @@ -213,7 +214,10 @@ def _get_timing(self, out, stim): """ durations = [stim.duration / out.shape[0]] * out.shape[0] - onsets = np.arange(0, stim.duration, durations[0]).tolist() + onsets = np.arange(0, stim.duration, durations[0]) + if stim.onset is not None: + onsets += stim.onset + onsets = onsets.tolist() orders = range(0, len(onsets)) return onsets, durations, orders