Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRG Handle triggers split between buffers #3738

Merged
merged 8 commits into from
Nov 8, 2016

Conversation

jasmainak
Copy link
Member

@jasmainak jasmainak commented Nov 5, 2016

Taking over #3696

Closes #3696 and #3695

cc @Odingod and @LauriParkkonen. Let me know if this works for you guys. Tests pass on my box.

@jasmainak jasmainak changed the title FIX Handle triggers split between buffers MRG Handle triggers split between buffers Nov 5, 2016
@codecov-io
Copy link

Current coverage is 87.42% (diff: 100%)

Merging #3738 into master will increase coverage by <.01%

@@             master      #3738   diff @@
==========================================
  Files           343        343          
  Lines         61000      61041    +41   
  Methods           0          0          
  Messages          0          0          
  Branches       9326       9332     +6   
==========================================
+ Hits          53326      53367    +41   
  Misses         4924       4924          
  Partials       2750       2750          

Sunburst

Powered by Codecov. Last update bc323fb...071df35

@larsoner
Copy link
Member

larsoner commented Nov 7, 2016

LGTM. @Odingod can you take a look?

@Odingod
Copy link
Contributor

Odingod commented Nov 7, 2016

Seems to be working, except for one small bug that is not worth fixing in my opinion. If the the first buffer starts with the trigger channel active the onset is missed and the code gets stuck like it used to. However the trigger channel shouldn't be high at the beginning of the measurement (unless using some kind of continuous measure pressure e.g.?). Maybe this is still worth a mention?

@Odingod
Copy link
Contributor

Odingod commented Nov 7, 2016

Let's take that back. There was trouble with a test I added that has two triggers at two consecutive buffer lines. For some reason the first one is not found. I'll take a closer what breaks this time. The test can be found from my branch if you'd like to take a look. On closer look everything was fine I just forgot to change the assertion comparison...

@jasmainak
Copy link
Member Author

On closer look everything was fine I just forgot to change the assertion comparison...

Great, so ready to merge?

Seems to be working, except for one small bug that is not worth fixing in my opinion. If the the first buffer starts with the trigger channel active the onset is missed and the code gets stuck like it used to. However the trigger channel shouldn't be high at the beginning of the measurement (unless using some kind of continuous measure pressure e.g.?). Maybe this is still worth a mention?

I would say it is expected that an event is not detected? Does this get detected as an event in the offline version? I think what is perhaps a bit unintuitive to the user is the "getting stuck" part since the isi_max is set to 0.5. I think it is worth changing this behavior so that the rt_client stops if there are no epochs even in the first isi_max seconds. I'd probably keep it for another PR. What do you think @Eric89GXL @Odingod ?

@jasmainak
Copy link
Member Author

Thanks @Odingod for taking a stab at this. Looking forward to more contributions! We should increase the bus factor of the realtime module.

@Odingod
Copy link
Contributor

Odingod commented Nov 8, 2016

@jasmainak changing the behavior so that the isi_max is respected in all situations might make things more consistent, but is worth a second PR. I don't see any other problems for merging, so go ahead!

@jasmainak jasmainak merged commit 6c2e222 into mne-tools:master Nov 8, 2016
@jasmainak jasmainak deleted the rt_missing_triggers branch November 8, 2016 12:32
@jasmainak
Copy link
Member Author

Merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants