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 partial_fit in Potato #133

Merged
merged 5 commits into from Aug 11, 2021
Merged

Conversation

qbarthelemy
Copy link
Member

@qbarthelemy qbarthelemy commented Jul 31, 2021

This PR:

  • add function partial_fit() in Potato, useful for online update;
  • complete tests;
  • update example on artifact detection.

@qbarthelemy
Copy link
Member Author

qbarthelemy commented Jul 31, 2021

@lkorczowski has put the artifact detection example in a Python notebook here:
https://github.com/lkorczowski/BCI-2021-Riemannian-Geometry-workshop/blob/master/notebooks/plot_detect_riemannian_potato_EEG.ipynb
with a nice javascript animation, adding these lines at the end

from IPython.display import HTML
plt.rcParams["animation.html"] = "jshtml"
potato

Following this idea, I try to add these lines:

from IPython.display import HTML
plt.rcParams["animation.embed_limit"] = 10
HTML(potato.to_jshtml(fps=5, default_mode='loop'))

But, in the new documentation, the last figure is plotted two times: with plt.show() and then with HTML(potato.to_jshtml()).
I don't know how to detect when code is executed in a ipynb, and in this case, do not call plt.show(). Any idea?

@qbarthelemy qbarthelemy added this to the v0.3 milestone Jul 31, 2021
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.

besides LGTM

doc/whatsnew.rst Outdated Show resolved Hide resolved
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.

merge if happy @qbarthelemy

Copy link
Member

@sylvchev sylvchev left a comment

Choose a reason for hiding this comment

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

All good to me!

@sylvchev
Copy link
Member

I don't know how to detect when code is executed in a ipynb, and in this case, do not call plt.show(). Any idea?

This could be useful: https://stackoverflow.com/a/22424821

@agramfort
Copy link
Member

@lkorczowski green button is yours

@qbarthelemy qbarthelemy merged commit d3578b4 into pyRiemann:master Aug 11, 2021
@qbarthelemy qbarthelemy deleted the rp_partialfit branch August 11, 2021 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants