You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
include_tmax not considered in mne.io.Raw.crop to check tmax in bounds #11196
When cropping a Raw to its exact duration without including tmax, the code crashes.
This is clearly an edge case, but I would expect this to work.
Am I wrong on this?
sklearn: 1.1.2
numba: Not found
nibabel: Not found
nilearn: Not found
dipy: Not found
cupy: Not found
pandas: 1.5.0
pyvista: Not found
pyvistaqt: Not found
ipyvtklink: Not found
vtk: Not found
qtpy: Not found
ipympl: Not found
pyqtgraph: Not found
pooch: Not found
mne_bids: Not found
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: Not found
mne_connectivity: Not found
mne_icalabel: Not found
But the rec has a duration of 1s. I should be able to crop it to 1s, no? That it crashes with include_tmax=True is obvious, I think. It asks for one additional time when it already crashes without it.
From my point of view, if I call crop with tmax=1 and include_tmax=False, internally tmax should be reduced to tmax - 1 / raw.info["sfreq"]. Does this make sense to you?
Activity
welcome commentedon Sep 22, 2022
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽♂️
agramfort commentedon Sep 23, 2022
@gemeinl with what you do you have
so the max time is not 1s. Even with
include_tmax=Trueit complains.Not sure how to proceed here...
gemeinl commentedon Sep 23, 2022
But the rec has a duration of 1s. I should be able to crop it to 1s, no? That it crashes with include_tmax=True is obvious, I think. It asks for one additional time when it already crashes without it.
From my point of view, if I call crop with tmax=1 and include_tmax=False, internally tmax should be reduced to tmax - 1 / raw.info["sfreq"]. Does this make sense to you?
agramfort commentedon Sep 23, 2022
can you try to open a PR about this and see if it breaks anything?
hoechenberger commentedon Sep 25, 2022
It appears we're off by one sample here, yes.
btw there's a bug in the HTML repr that is not present in the text repr: