Skip to content

ENH: add corrmap.#1985

Closed
dengemann wants to merge 66 commits intomne-tools:masterfrom
dengemann:patch-3
Closed

ENH: add corrmap.#1985
dengemann wants to merge 66 commits intomne-tools:masterfrom
dengemann:patch-3

Conversation

@dengemann
Copy link
Copy Markdown
Member

Taking over #1795

@dengemann dengemann mentioned this pull request Apr 20, 2015
Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

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 :)

@larsoner
Copy link
Copy Markdown
Member

Other than my comments, LGTM, but I don't really know much about the ICA code

@dengemann
Copy link
Copy Markdown
Member Author

deleted comment, wrong issue.

@agramfort
Copy link
Copy Markdown
Member

agramfort commented Apr 20, 2015 via email

@larsoner larsoner added this to the 0.9 milestone Apr 20, 2015
@larsoner
Copy link
Copy Markdown
Member

@agramfort #1795, the PR that this one superceded, was marked for 0.9 so I think yeah he wants it for the release

@dengemann
Copy link
Copy Markdown
Member Author

do you want this merged for the release?

let's try to do that.

@larsoner
Copy link
Copy Markdown
Member

@dengemann don't forget about this one

@dengemann
Copy link
Copy Markdown
Member Author

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.

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

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 :)

@dengemann
Copy link
Copy Markdown
Member Author

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.

  • move nested functions to private functions at the module level
  • remove try catch blocks

@dengemann
Copy link
Copy Markdown
Member Author

and some minor points.

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

I have a bit of time now, I'll try to get at least one of the big two

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

that is, this week, not right now :)

@larsoner
Copy link
Copy Markdown
Member

I'll just do it now, they're my gripes anyway :)

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

better still!

@dengemann
Copy link
Copy Markdown
Member Author

@Eric89GXL you do have push access. Feel free to work on my PR.

@larsoner
Copy link
Copy Markdown
Member

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 read_meas_info one is a good example of the ask for forgiveness principle IMO) by checking for failure conditions. Note that this is also a better approach because it avoided a spewing of numpy warnings in some cases before hitting the eventual ValueError.

Copy link
Copy Markdown
Member

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

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.0%) to 90.29% when pulling 0ca2a34 on dengemann:patch-3 into 6b08e27 on mne-tools:master.

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.0%) to 90.29% when pulling 0ca2a34 on dengemann:patch-3 into 6b08e27 on mne-tools:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-1.83%) to 88.46% when pulling 0ca2a34 on dengemann:patch-3 into 6b08e27 on mne-tools:master.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

rm empty line

@wmvanvliet
Copy link
Copy Markdown
Contributor

the current implementation breaks if there are more then 20 IC's being plotted:

/Users/rodin/BRU/mne-python/mne/preprocessing/ica.py in _plot_corrmap(data, subjs, indices, ch_type, ica, label, show, outlines, layout, cmap, contours)
   2189         figs = [_plot_corrmap(data[k:k + p], subjs[k:k + p],
   2190                 indices[k:k + p], ch_type, ica, label)
-> 2191                 for k in range(0, n_components, p)]
   2192         return figs
   2193     elif np.isscalar(picks):

TypeError: _plot_corrmap() takes exactly 11 arguments (6 given)

Copy link
Copy Markdown
Contributor

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.

@larsoner
Copy link
Copy Markdown
Member

@dengemann should we move this to 0.10, or do you have time to finish it?

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

Would it help if I made proposals/PRs for the problems noted by @wmvanvliet and I?

@dengemann
Copy link
Copy Markdown
Member Author

As said before please take over if you have time.

On 29 Apr 2015, at 13:23, jona-sassenhagen notifications@github.com wrote:

Would it help if I made proposals/PRs for the problems noted by @wmvanvliet and I?


Reply to this email directly or view it on GitHub.

@larsoner larsoner mentioned this pull request May 12, 2015
@agramfort
Copy link
Copy Markdown
Member

I would move this to 0.10... but you can object...

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

@agramfort I think this is basically done.

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

I have a PR addressing the problems noted by wmvanvliet and I.

@larsoner
Copy link
Copy Markdown
Member

After that is merged it will need a rebase, too

@larsoner
Copy link
Copy Markdown
Member

@dengemann if you are swamped I can merge the PR into your branch and rebase

@agramfort
Copy link
Copy Markdown
Member

agramfort commented May 12, 2015 via email

@dengemann
Copy link
Copy Markdown
Member Author

Agreed. Let's move slowly, test it extensivel, and keep it on master for
now.

2015-05-12 21:59 GMT+02:00 Alexandre Gramfort notifications@github.com:

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...


Reply to this email directly or view it on GitHub
#1985 (comment)
.

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

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 ...

@agramfort
Copy link
Copy Markdown
Member

agramfort commented May 12, 2015 via email

@dengemann
Copy link
Copy Markdown
Member Author

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 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


Reply to this email directly or view it on GitHub
#1985 (comment)
.

@dengemann dengemann modified the milestones: 0.10, 0.9 May 12, 2015
@jona-sassenhagen
Copy link
Copy Markdown
Contributor

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?..

@agramfort
Copy link
Copy Markdown
Member

agramfort commented May 16, 2015 via email

@jona-sassenhagen
Copy link
Copy Markdown
Contributor

Close for #2104?

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.

6 participants