-
Notifications
You must be signed in to change notification settings - Fork 206
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
IPywidgets UI #1544
IPywidgets UI #1544
Conversation
A few more:
If you could please add a bit of documentation to the dev guide, this will help us to give a hand with this! ;) |
Thanks! |
I'm not very familiar with IPywidgets: can they work outside a notebook? In other words: without a web browser? |
No, they're HTML widgets. The nice things is that we're not replacing/removing traitsui, we are adding a "jupyter notebook interface". |
This is super cool. Is it expected behavior right now that the traits gui also opens when you call the methods? |
This is WIP so we still have to decide those sort of things. What I would suggest is:
Opinions more than welcome! |
hyperspy/gui/__init__.py
Outdated
@@ -38,7 +38,7 @@ def set_ets_toolkit(toolkit): | |||
_logger.debug('Current MPL backend: %s', backend) | |||
if "WX" in backend: | |||
set_ets_toolkit("wx") | |||
elif "Qt" in backend: | |||
elif "Qt4" in backend: |
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 it fixing #1559? If so, does it mean that instead of using %matplotlib qt
, we should recommend using %matplotlib qt4
, before importing hyperspy?
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.
No, it's not fixing #1559. This fixes using that qt5 backend albeit without the traitsui gui as it does not yet support qt5.
The ipywidgets give us a lot more flexibility when choosing the mpl backend as the ipywidgets are obviously backend independent. Therefore this PR should make hspy usable with e.g. tk or nbagg.
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.
Ok. Forgot my previous comment, it does not make sense...
@thomasaarholt, @magnunor and @vidartf, thank you for reporting the issues. I think that I have fixed them all except for the image contrast editor that, I suspect, is a mpl issue that will get solved in mpl 2.1 when the canvas becomes an ipywidget. Is anybody against merging this? |
Thanks @ericpre, @thomasaarholt and @vidartf for reviewing and beta testing this. |
I have tried my best to follow the steps as clearly as possible but I am still getting /anaconda3/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from after trying to I downloaded the github files onto my mac os and then did the pip installs of the hyperspy-gui-traitsui and the ipywidgets I have installed hyperspy on windows in the past and the process seems a lot simpler. Any help would be greatly appreciated. I am to some extent still very new to hyperspy so I really dont mind even what seems like an obvious answer. |
@carmenmakepeace, this is an old pull request that has been merged. For installing the latest HyperSpy and hyperspy_gui_ipywidgets you can follow the instruction in the User Guide and the hyperspy_gui_ipywidgets repository. Due to recent updates to external libraries, things may not go as smoothly as they should. If you experience any issue you are welcome to ask for help in hyperspy's gitter chat. |
In this PR
AxesManager.show
andSignal1D.integrate_in_range
.roi.SpanRoi
.SpanRoi
.hs.link_directional
andhs.link_bidirectional
functions to link traits, traitlets and traits to traitlets.To test it
jupyter nbextension enable --py --sys-prefix widgetsnbextension
Install https://github.com/hyperspy/hyperspy_gui_traitsui and/or https://github.com/hyperspy/hyperspy_gui_ipywidgets and https://github.com/hyperspy/link_traits .
Then start hyperspy as usual using any matplotlib backend except the inline backend. This PR makes the nbagg backend usable. To use try it:
TODO
Widgets
gui
instead ofget_gui
where possibleDeprecate:
Other tasks
(am I missing something else?)