mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

FIX: blink annotations eyetracking/pupilometry

Open schekroud opened this issue 1 year ago • 6 comments

Reference issue

Fixes #12408

What does this implement/fix?

properly adjusts blink onsets/offsets to account for the start time of the signal. This allows you to crop the signal and still have an accurate description of blink onsets

schekroud avatar Feb 02 '24 19:02 schekroud

@scott-huberty @larsoner sorry if i have completely screwed up how you guys normally do this - i closed the previous PR (i dont think i could edit the code once the PR was made) as i noticed it didn't import the annotations function needed (i incorrectly assumed it would be there by default, but then tested and found i was wrong).

This should work!

Again, sorry if i have messed up the normal workflow 😆

schekroud avatar Feb 02 '24 19:02 schekroud

@schekroud you can just edit the code in your schekroud:main branch on GitHub and those changes will be reflected in the PR. No need to close and open a new one

larsoner avatar Feb 02 '24 19:02 larsoner

No worries @schekroud there can be a learning curve for PR's. Have you read the contributing guide? I still use it from time to time to remind myself.

One comment (@larsoner can correct me if it isn't a big deal in this case), usually it's best to open a PR from a development branch (not your main branch). This should be covered in the contributing guide (let us know if it isn't).

scott-huberty avatar Feb 02 '24 20:02 scott-huberty

I just took a closer look at this PR. It looks like most of the failing tests are unrelated, and I think all of them should have been fixed by recently merged PR's (i.e. #12417 ).

@schekroud if you do want to work on this PR from a development branch here is what I would do:

git commands

(Assuming you are in the mne-python github respoitory directory, and on your main branch):

# note I have edited the commands below since initially posting this comment

# checkout new branch, bringing over commits from y9ou rmain branch
git checkout -b fix_interpolate_blinks

# add a link to the mne-python github repo, we'll call it "upstream"
git remote add upstream https://github.com/mne-tools/mne-python.git

# bring in the latest changes that have been merged into mne-python
git fetch upstream main
git merge upstream/main --ff-only

# push your new local development branch to your remote fork
 git push --set-upstream origin fix_interpolate_blinks

Then you could open another PR and close this one.

resetting your main branch to be in line with mne-pythons main branch

if you create a new branch with the changes from this PR, you'll want to reset your main branch:

git checkout main

git reset --hard upstream/main

Either way (you create a new dev branch or just continue this PR from your main branch), There a couple things to do.

  1. add a new rst file to doc/changes/devel that describe the changes made by this PR. See https://mne.tools/dev/development/contributing.html#describe-your-changes-in-the-changelog
  2. @larsoner should we amend test_interpolate_blinks to include a test with a cropped raw object?

scott-huberty avatar Feb 05 '24 22:02 scott-huberty

Hi @schekroud do you still have time to work on this? I think you just need to merge in the updates to mne since your last commit, and add an entry to the changelog (see point 1 in my previous message). Let me know if you need any support from us!

scott-huberty avatar Mar 12 '24 17:03 scott-huberty

I merged main. A test should be added to cover the previous failure.

mscheltienne avatar Mar 17 '24 07:03 mscheltienne