Skip to content

Fig bug with ica.plot_components when axes is provided#11654

Merged
larsoner merged 11 commits intomne-tools:mainfrom
mscheltienne:ax_topo
Apr 25, 2023
Merged

Fig bug with ica.plot_components when axes is provided#11654
larsoner merged 11 commits intomne-tools:mainfrom
mscheltienne:ax_topo

Conversation

@mscheltienne
Copy link
Copy Markdown
Member

Closes #11653

Copy link
Copy Markdown
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

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

Other than one minor gripe about potential testing time LGTM, thanks @mscheltienne !

Comment on lines +114 to +116
ica = ICA(n_components=None)
ica_picks = _get_picks(raw) # 9 channels
ica.fit(raw, picks=ica_picks)
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.

Any way you can get away with not doing another .fit? All these ICA fits add up in testing time

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 tried to, but the other one above only fits 2 components which are not enough for all the cases below.
However, I did check that it fits in less than a second.

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.

However, I did check that it fits in less than a second.

Okay, just keep in mind the ideal target is much less than 1 sec when possible. pytest -m 'not ultraslowtest' collects 3863 items for me so every bit counts. But it can be tough to optimize for ICA so we can live with it here 👍

At some point it would probably be good to do a minimal set of ica.fits and copy() the objects around implicitly via a new ica_raw_9comp fixture or so for example. But that can be for another PR :)

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.

That's fair, so done. It's easy enough to do for short test functions ;)

@larsoner larsoner added this to the 1.4 milestone Apr 24, 2023
@mscheltienne
Copy link
Copy Markdown
Member Author

I'll update the docstring too, as per the comment of @hoechenberger on the issue.

@larsoner
Copy link
Copy Markdown
Member

Thanks for going the extra mile (or 1.6 km) here @mscheltienne !

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.

ICA plot_components on provided axes fails

2 participants