DOC: document first_samp behavior after crop and RawArray workaround#13685
DOC: document first_samp behavior after crop and RawArray workaround#13685Famous077 wants to merge 7 commits intomne-tools:mainfrom
Conversation
|
Hello! 👋 Thanks for opening your first pull request here! ❤️ We will try to get back to you soon. 🚴 |
for more information, see https://pre-commit.ci
|
Hi @larsoner , Added reset_first_samp=False parameter to Raw.crop() as suggested. |
|
Hi @mscheltienne , Could you please take a look when you have time? I’d really value your perspective and any suggestions for improvement. |
| If True, reset :term:`first_samp` to 0 after cropping, treating | ||
| the cropped segment as an independent recording. Note that this | ||
| can break things if you extracted events before cropping and try | ||
| to use them afterward. Default is False. |
There was a problem hiding this comment.
Hi @larsoner, thank you for the review. I have addressed all the feedbacks:
- Renamed changelog to
13685.other.rst - Added
.. versionadded:: 1.12toreset_first_sampdocstring - Added regression test
test_crop_reset_first_samp - Updated changelog to use
:newcontrib:format - Disclosed AI usage in the PR description
for more information, see https://pre-commit.ci
|
@Famous077 if you used AI tools during the development of these changes, could you let us know how you used them? |
Reference issue (if any)
Fixed #13278
-->
What does this implement/fix?
Adds a reset_first_samp=False parameter to Raw.crop() that allows
users to treat cropped segments as independent recordings. When set
to True, first_samp is reset to 0 after cropping.
Also adds a Notes section to the docstring explaining the default
first_samp behavior after cropping and documents the RawArray
workaround for users who prefer that approach.
Additional information
As noted in the docstring, setting reset_first_samp=True can break
things if events were extracted before cropping and used afterward.
This is clearly documented in the parameter description to warn users.
The default is False to maintain backward compatibility with existing
code.
note :
This PR was developed with the assistance of an AI coding assistant for guidance on code structure, docstring formatting, and implementation approach.