-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ENH: add corrmap. #1985
ENH: add corrmap. #1985
Conversation
sim_i_o = np.abs(np.corrcoef(target, newtarget)[1, 0]) | ||
|
||
return newtarget, median_corr_with_target, sim_i_o, max_corrs | ||
except IndexError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more elegant way to do this? a problem with try/except
over a bunch of lines is that sometimes you end up hitting an unintended error. It's also not clear from the code where or why an IndexError
would occur, so it's also harder for the next person to deal with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know ... tried to brainwash @jona-sassenhagen but he was very resistant so far.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the "it's easier to ask for forgiveness then for permission" mentality, but it's not clear in this code what the forgiveness would even be for, which makes it difficult to understand. I think it's typically applied to a single or a couple lines of code. Looking at these ~10 lines of code deeper I still can't figure out where to expect an indexing error, which is not a good sign.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. let's figure it out :)
Other than my comments, LGTM, but I don't really know much about the ICA code |
deleted comment, wrong issue. |
do you want this merged for the release?
|
@agramfort #1795, the PR that this one superceded, was marked for 0.9 so I think yeah he wants it for the release |
let's try to do that. |
@dengemann don't forget about this one |
I'm hesitating / thinking about moving this to 0.10. Let me see how this weeks schedule develops (unless @jona-sassenhagen want's to complete it). At this stage it's more important though to fix bugs than adding new features. |
Is there anything major missing? I wouldn't stress it being a .9 feature, but I'd like to have it merged so the people I work with have an easier time using it :) |
Nope just addressing the comments.
|
and some minor points. |
I have a bit of time now, I'll try to get at least one of the big two |
that is, this week, not right now :) |
I'll just do it now, they're my gripes anyway :) |
better still! |
@Eric89GXL you do have push access. Feel free to work on my PR. |
done, @dengemann and/or @jona-sassenhagen please have a look. I got rid of the try/excepts other than the one I thought made sense (the |
@@ -933,7 +935,10 @@ def find_bads_ecg(self, inst, ch_name=None, threshold=None, | |||
raise ValueError('Method "%s" not supported.' % method) | |||
# sort indices by scores | |||
ecg_idx = ecg_idx[np.abs(scores[ecg_idx]).argsort()[::-1]] | |||
return list(ecg_idx), scores | |||
if not hasattr(self, 'labels_'): | |||
self.labels_ = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{} -> dict()
it's more explicit
1 similar comment
used (via .add_artist). Defaults to True. | ||
contours : int | False | None | ||
The number of contour lines to draw. If 0, no contours will be drawn. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm empty line
the current implementation breaks if there are more then 20 IC's being plotted:
|
"""Customized ica.plot_components for corrmap""" | ||
import matplotlib.pyplot as plt | ||
|
||
title = 'Detected components of type ' + label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Label defaults to None and should stay None for dry runs, in which case we get an error here.
@dengemann should we move this to 0.10, or do you have time to finish it? |
Would it help if I made proposals/PRs for the problems noted by @wmvanvliet and I? |
As said before please take over if you have time.
|
I would move this to 0.10... but you can object... |
@agramfort I think this is basically done. |
I have a PR addressing the problems noted by wmvanvliet and I. |
After that is merged it will need a rebase, too |
@dengemann if you are swamped I can merge the PR into your branch and rebase |
my 0.5 concern is that I don't know if this method is what we should
advertise and it's currently the best we can offer. The problem when adding
code to a package is that it never goes away so we need to think twice...
|
Agreed. Let's move slowly, test it extensivel, and keep it on master for 2015-05-12 21:59 GMT+02:00 Alexandre Gramfort notifications@github.com:
|
On master instead of release? Fine with me. @dengemann, I'm up for a massive test comparing different ICA and IC identification mechanisms on many data sets ... |
I would vote not to merge this to master before someone does an big
validation like you proposed. If we merge to master it will be released in
the following release
|
I meant merge it to 0.10 master once it's open and once we're happy. 2015-05-12 22:13 GMT+02:00 Alexandre Gramfort notifications@github.com:
|
I've finally fixed the stuff that went broke in the meantime with updates on master (e.g. giving everything a show keyword destroyed the plotting), should I make a new PR or PR to @dengemann 's repo?.. |
Make a new PR to take the lead and get some free time to @dengemann ;)
|
Close for #2104? |
Taking over #1795