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

Using edit_physio() in Spyder breaks console after closing interactive plot session. #36

Open
smoia opened this issue Oct 16, 2020 · 13 comments
Assignees
Labels
Bug Something isn't working Wontfix This will not be worked on

Comments

@smoia
Copy link
Member

smoia commented Oct 16, 2020

This happens in Spyder 4 (didn't test on previous Spyder versions), in Ubuntu 18.04 and latest winpython.
If we can figure out why, it would be great - starting with trying to reproduce the problem in different environments @physiopy/all .

@smoia smoia added the Bug Something isn't working label Oct 16, 2020
@smoia
Copy link
Member Author

smoia commented Oct 29, 2020

Update: it seems it's a problem related to the Qt4Agg and Qt5Agg backends in Spyder. Using the same backend from a python console (e.g. IPython) doesn't raise any issue. @rmarkello, which backend were you using when you were coding peakdet?

@rmarkello
Copy link
Member

Oh jeez, that's a tough question... I was almost certainly using one of those you listed: likely originally Qt4Agg and then later Qt5Agg. I know that Spyder has a lot of confirmed graphical compatibility issues (e.g., I know it has bugs with the tqdm module). Note that I have never used Spyder myself, so all development was done in Python/IPython, exclusively.

@smoia
Copy link
Member Author

smoia commented Oct 29, 2020

Ok, that's good to know! Out of curiosity, did you also test it in a jupyter notebook? Does it work without issues?
I guess that then we can just add a warning in the documentation saying not to use it in Spyder...

@sangfrois
Copy link
Member

@smoia : I tested it in a jupyter notebook yesterday! that's a funny coincidence. I was thinking of posting something here to cover the issue.

At first I thought it may be a %pylab inline or %matplotlib inline confusion, but then I realized the issue was too complex for me to describe properly. Here I am : it doesn't work in jupyter.

@smoia
Copy link
Member Author

smoia commented Oct 29, 2020

Mmm, like this it might be a bit difficult to "debug", but I'd say the first thing we can do is to write in the readme and in the documentation that we don't guarantee that the interactive plot session works in Spyder or Jupyter notebook. Sounds good?

@sangfrois
Copy link
Member

Sounds right yeah. Pin me if you think you'd need me to send a PR

@smoia
Copy link
Member Author

smoia commented Oct 30, 2020

Sure! Why don't you go on and open a PR?

@rmarkello
Copy link
Member

@sangfrois @smoia: you will likely need to install ipympl and enable it with %matplotlib widget for use of peakdet in Jupyter notebooks! That is, loss of interactivity in maptlotlib plots is a standard feature of Jupyter notebooks and is not just peakdet specific. (That's not to say peakdet will 100% work with this solution, but it definitely won't work without it.)

(Also to explicitly answer @smoia's previous question: no, I had never tried testing in Jupyter!)

@smoia
Copy link
Member Author

smoia commented Oct 30, 2020

Ah, nice!
@sangfrois care to try it out? If it works we can add ipympl as an extra dependency!

@sangfrois
Copy link
Member

sangfrois commented Oct 30, 2020

i think I've tried, but let me give it a shot again! I'll pin you once I'm done!

@sangfrois
Copy link
Member

sangfrois commented Oct 30, 2020

Ok, so : I've tried installing ipympl and executing %matplotlib widget to get the interactive plot (using operation.edit_physio(data)) and only got that string.

<matplotlib.axes._subplots.AxesSubplot at 0x1f3b07b9470>

Something seems to be processed here, so I've double checked with %matplotlib inline and got a static figure.

Assuming that the string output meant there was a plot object, I've tried to call plt.show() and got nothing 😢

Everything works fine in my terminal though. Even got the chance to try out the GUI. Looks great 😁

Here @smoia @rmarkello is there any other little tests you'd want me to try out?

@smoia
Copy link
Member Author

smoia commented Nov 4, 2020

New question: does the library need OpenGL?

@smoia smoia added the Wontfix This will not be worked on label Nov 5, 2020
@rmarkello
Copy link
Member

@smoia: I'm not sure! I want to say no, probably not, but did very limited testing on this whole thing 😅 Sorry to not be of more help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Wontfix This will not be worked on
Projects
Status: Todo
Development

No branches or pull requests

3 participants