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: Add nirs support to ICA topoplot #7427

Merged
merged 10 commits into from
Mar 17, 2020

Conversation

rob-luke
Copy link
Member

Reference issue

Ongoing fNIRS improvements for #7057

What does this implement/fix?

Adds support for plotting Ica components.

@rob-luke rob-luke force-pushed the fnirs_ica_topomap branch from d200ebe to 257a4a9 Compare March 12, 2020 08:15
@codecov
Copy link

codecov bot commented Mar 12, 2020

Codecov Report

Merging #7427 into master will increase coverage by 0.08%.
The diff coverage is 90.24%.

@@            Coverage Diff             @@
##           master    #7427      +/-   ##
==========================================
+ Coverage   90.06%   90.14%   +0.08%     
==========================================
  Files         454      454              
  Lines       82323    83352    +1029     
  Branches    13022    13333     +311     
==========================================
+ Hits        74143    75139     +996     
- Misses       5360     5380      +20     
- Partials     2820     2833      +13     

@agramfort
Copy link
Member

tell us when to look @rob-luke

@rob-luke
Copy link
Member Author

Tests look to be passing but codecov has decreased, so trying the test dataset that has overlapping channels to hit those lines.

@rob-luke
Copy link
Member Author

@larsoner and @agramfort could you please review this PR

@rob-luke rob-luke changed the title WIP: Add nirs support to ICA topoplot MRG: Add nirs support to ICA topoplot Mar 15, 2020
@rob-luke
Copy link
Member Author

Sorry I’ve broken the tests. Please don’t review. I will fix tomorrow

@rob-luke
Copy link
Member Author

Ok finally all green 😡

@larsoner and @agramfort could you please review.

@agramfort
Copy link
Member

rather than branching with an if in each function that calls _merge_grad_data I would suggest to rename _merge_grad_data to _merge_ch_data and do the if branch in a single place. Doing a git grep _merge_grad_data shows you that you made it otherwise do it in other places later

@rob-luke
Copy link
Member Author

Thanks @agramfort. Have I understood your suggestion correctly (based on my last commit)? Not ready for another review yet (CI is still yellow), just want to know if I understood your comment correctly.

@agramfort
Copy link
Member

agramfort commented Mar 16, 2020 via email

@rob-luke
Copy link
Member Author

Thanks @agramfort. _merge_ch_data takes different arguments to _merge_grad_data and returns two variables not one. So will take more extensive changes than I can do now. But glad I understand what you mean, I'll get on it.

@rob-luke rob-luke changed the title MRG: Add nirs support to ICA topoplot WIP: Add nirs support to ICA topoplot Mar 16, 2020
@rob-luke
Copy link
Member Author

@larsoner I can't understand what's causing these CIs to fail. Could you please give me hint.

@rob-luke rob-luke changed the title WIP: Add nirs support to ICA topoplot MRG: Add nirs support to ICA topoplot Mar 17, 2020
@larsoner
Copy link
Member

Travis and Azure are having segfaults in the last few days, unfortunately for now you'll have to look at the logs to make sure your tests are passing :(

@rob-luke
Copy link
Member Author

rob-luke commented Mar 17, 2020

Ok my tests are passing in the CI, except for what looks like a random error. And tests are passing on my PC.

@agramfort and @larsoner could you please review.

Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

diff looks ok except changes to public API without deprecations.

_merge_grad_data is not used anymore anywhere except in new function _merge_ch_data?

mne/evoked.py Outdated
@@ -312,7 +312,7 @@ def plot_image(self, picks=None, exclude='bads', unit=True, show=True,
def plot_topo(self, layout=None, layout_scale=0.945, color=None,
border='none', ylim=None, scalings=None, title=None,
proj=False, vline=[0.0], fig_background=None,
merge_grads=False, legend=True, axes=None,
merge_channels=False, legend=True, axes=None,
Copy link
Member

Choose a reason for hiding this comment

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

you cannot change public APIs like that. We need deprecation cycles.

Copy link
Member

Choose a reason for hiding this comment

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

To be honest I would revert this one unless you need it already for NIRS

Copy link
Member Author

Choose a reason for hiding this comment

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

No don't need this at all. I just misunderstood a previous comment and thought I was meant to change all occurrences of merge grad to merge channels. I'll change this back

mne/evoked.py Outdated
@@ -526,7 +526,7 @@ def get_peak(self, ch_type=None, tmin=None, tmax=None,
Defaults to 'abs'.
time_as_index : bool
Whether to return the time index instead of the latency in seconds.
merge_grads : bool
merge_channels : bool
If True, compute peak from merged gradiometer data.
Copy link
Member

Choose a reason for hiding this comment

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

same here. And docstrings should then be updated. To be honest I would revert this one unless you need it already for NIRS

@agramfort
Copy link
Member

agramfort commented Mar 17, 2020 via email

@rob-luke
Copy link
Member Author

all good. I will leave all internal calls at merge_channels, and revert all public api to merge_grads.

@agramfort
Copy link
Member

agramfort commented Mar 17, 2020 via email

Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

my bad. LGTM

@larsoner larsoner added this to the 0.20 milestone Mar 17, 2020
@larsoner larsoner merged commit 586c09f into mne-tools:master Mar 17, 2020
@larsoner
Copy link
Member

Thanks @rob-luke

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.

3 participants