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

Add multifrequency detection to txt files #150

Merged
merged 24 commits into from
Mar 5, 2020

Conversation

vinferrer
Copy link
Collaborator

@vinferrer vinferrer commented Feb 21, 2020

Closes #56
Adds multi frequency support for labchart files

Proposed Changes

-Adds multi frequency support for labchart files

@vinferrer vinferrer self-assigned this Feb 21, 2020
@vinferrer vinferrer added the Enhancement New feature or request label Feb 21, 2020
@vinferrer vinferrer added this to the phys2bids first non-beta milestone Feb 21, 2020
@vinferrer vinferrer marked this pull request as ready for review February 21, 2020 15:17
@codecov
Copy link

codecov bot commented Feb 21, 2020

Codecov Report

Merging #150 into master will increase coverage by 1.61%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #150      +/-   ##
==========================================
+ Coverage   65.04%   66.66%   +1.61%     
==========================================
  Files           7        7              
  Lines         515      540      +25     
==========================================
+ Hits          335      360      +25     
  Misses        180      180
Impacted Files Coverage Δ
phys2bids/interfaces/txt.py 96% <100%> (+0.79%) ⬆️

@vinferrer vinferrer requested review from smoia and eurunuela February 21, 2020 15:17
Copy link
Collaborator

@eurunuela eurunuela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but we're gonna have to add a test for this function in test_txt.py

@vinferrer
Copy link
Collaborator Author

unit test added closing #151

@vinferrer vinferrer requested a review from eurunuela February 25, 2020 15:57
Copy link
Member

@smoia smoia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start, let's see if we can improve it a bit more!

phys2bids/interfaces/txt.py Outdated Show resolved Hide resolved
phys2bids/interfaces/txt.py Outdated Show resolved Hide resolved
phys2bids/tests/test_txt.py Outdated Show resolved Hide resolved
phys2bids/tests/test_txt.py Outdated Show resolved Hide resolved
@eurunuela
Copy link
Collaborator

I would not check the channel at random positions. I think it would be wiser to check the start, middle and end of the channel unless we are certain that whatever random positions we choose the result will always be the same.

@smoia
Copy link
Member

smoia commented Feb 28, 2020

It's actually more probable that the results will be the same checking three random positions in the middle rather than at the start and the end - in files that start earlier than the beginning of the sequence and have padding at the end, the trigger channel (and any other similar thing) might have the same value at the beginning and at the end for more than your sampling. This might lead to incorrect frequency classification.

@smoia
Copy link
Member

smoia commented Feb 28, 2020

Solution: why don't we open an issue about it, and merge in this PR?

@vinferrer
Copy link
Collaborator Author

We can discuss about this, I propose that the function does the process that is doing right now but in 3 subarrays that are seeded in random positions and put the size of these positions as an optional parameter

@vinferrer
Copy link
Collaborator Author

but if you want we can merge this for the moment

@vinferrer
Copy link
Collaborator Author

So, what do we do here?

Copy link
Member

@smoia smoia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's merge it in now and open an issue about improving the multifreq check.

@smoia
Copy link
Member

smoia commented Mar 5, 2020

As soon as @eurunuela agrees on the changes, you can merge this in!

@vinferrer
Copy link
Collaborator Author

let me solve the merge conflic

@smoia
Copy link
Member

smoia commented Mar 5, 2020

However, please update your branch with respect to the master branch

@vinferrer
Copy link
Collaborator Author

@smoia, @eurunuela I think with this last commit I solved the problem with the while loop. Now instead of limiting the while loop to a fix number, I get the maximum number of repeated samples as a reference, This way the number of samples that are not tested for multi frequency in each channel is reduce to a few hundred but the hole array is inspected without need of dividing it. This means we don't have to open an issue about improving the multifrequency check

@vinferrer
Copy link
Collaborator Author

therefore I think @smoia needs to check again the function

@vinferrer vinferrer requested a review from smoia March 5, 2020 14:01
@vinferrer
Copy link
Collaborator Author

vinferrer commented Mar 5, 2020

Sry for ruining your approval

Copy link
Collaborator

@eurunuela eurunuela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me in general aside from the triple loop. However I think a couple of points should be resolved before merging.

phys2bids/interfaces/txt.py Show resolved Hide resolved
phys2bids/interfaces/txt.py Outdated Show resolved Hide resolved
phys2bids/interfaces/txt.py Outdated Show resolved Hide resolved
phys2bids/interfaces/txt.py Show resolved Hide resolved
vinferrer and others added 3 commits March 5, 2020 15:19
Co-Authored-By: Eneko Uruñuela <13706448+eurunuela@users.noreply.github.com>
@vinferrer
Copy link
Collaborator Author

Nice, Once @smoia finishes with the review I will merge

Copy link
Member

@smoia smoia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vinferrer vinferrer merged commit 76b51b2 into physiopy:master Mar 5, 2020
@vinferrer vinferrer deleted the multifreq branch March 6, 2020 08:38
@smoia smoia mentioned this pull request Mar 27, 2020
2 tasks
@smoia smoia added the Minormod This PR generally closes an `Enhancement` issue. It increments the minor version (0.+1.0) label Mar 27, 2020
@vinferrer vinferrer changed the title Multifreq Add multifrequency detection to txt files Mar 31, 2020
@smoia smoia added the released This issue/pull request has been released. label Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Minormod This PR generally closes an `Enhancement` issue. It increments the minor version (0.+1.0) released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add multifrequency support to labchart txt files
3 participants