Closed CasperWA closed 2 years ago
Maybe as an additional comment, the group headers are currently not visually distinguished in my environment. I'm not sure what the reason for that could be.
Maybe as an additional comment, the group headers are currently not visually distinguished in my environment. I'm not sure what the reason for that could be.
Could you show an example?
I'm not very diverse in my browser choices for testing, using only Chrome, so this might be the issue? Although I am using nothing else but the standard HTML tag options, I believe.
Can you check whether the latest version of develop
works? Or should I release a new version for you to more easily test? @csadorf
Can you check whether the latest version of
develop
works? Or should I release a new version for you to more easily test? @csadorf
@CasperWA Thanks for proposing a fix. I'm gonna test this, no release or prerelease needed.
@CasperWA I've tested it and this is what it looks like on my developer machine:
$ pip freeze | grep ipywidgets
ipywidgets==7.6.5
ipywidgets-extended==1.1.1
Selecting "General" does not crash the app anymore, but still kind of unexpected that it is even possible to select the headers. I tested it on Firefox and Chrome, same issue in both browsers.
@CasperWA You should be able to reproduce the issue with the following steps:
git clone https://github.com/aiidalab/aiidalab-docker-stack
cd ./aiidalab-docker-stack/
pip install -r requirements-manage.txt # for docker-compose and click
./manage.py configure --app quantum-espresso==21.10.0b1
./manage.py --develop -v up
https://user-images.githubusercontent.com/1441208/139038845-89c68486-ae06-4ad6-bd50-cba3b022937d.mp4
I can reproduce this on my computer OS: Ubuntu 20.04.3 LTS Browser: Chrome and Firefox
Downgrade the ipywidgets-extended
version to ipywidgets-extended==1.1.0
and selecting "General" DOES crash the app again.
@unkcpz noticed that on a different deployment, the widget works as expected, however we are not able to figure out what is causing that.
pip list --format=freeze
between the non-working (left) and working (right) environment:
Hmm... this is very peculiar. So to me this might come down to two things, and both things might be wrong for where to go to try and find the issue:
ipywidgets-extended
package into the Jupyter environment.
It's not uncommon that a widget is not properly installed as a notebook extension (nbextension
). It could be that the installation protocol for the package isn't rigorous enough and doesn't find the proper place to install itself to enable it as a proper extension or that it doesn't have the rights upon installation to place itself in some critical Jupyter locations?
Using virtuelenv
this seems to work fine, it uses the nbconfig
file under the respective virtual environment (e.g., ~/.venvs/ipywidgets/etc/jupyter/nbconfig
, where ipywidgets
is the name of the venv). However, it may be that this fails under other conditions?The latter is what I'd check first, however, usually if they're not loaded properly it just doesn't show the widget at all. It simply doesn't show up. But it may still be that this is the issue and we're just seeing a different error than normal... It's all quite confusing to be honest 😅 😟
* It's an OS/browser support related. The idea here is that it might be caused by some incompatibilities or short-comings (uninstalled fluff plugins) for a bare-bones linux OS for any given browser.
I highly doubt that, since we were able to reproduce the issues on Mac OS-X/Linux with both Firefox and Chrome and on top of that, it did work fine in one of the deployments using the same system. So I would say it's almost impossible to be OS or browser-related.
@CasperWA Would you mind trying to reproduce the issue with the steps shown above (it should only take 5-10mins) and at least confirm that you observe it in your system? Maybe you can check the browser console or so and see if you recognize any of the errors or warnings?
I get the same thing happening when I use the approach you have mentioned above.
I tried installing the OPTIMADE Client application as well, and have been looking into the Chrome DevTools to try and see what's going on. There are several things I could point out, but I am completely unaware whether they are the culprits or not.
One is this "find-and-replace" that's missing. I don't know what it is. Find and replace widgets/code or just something else completely?
Then there's this entry, which I don't see if I simply open the "clean" Voilà edition of the client. I cannot see whether it thinks this is an error or it's just printing stuff out to the console. It might simply be the latter.
It should be noted it loads the ipywidgets_extended/extension
fine. And this also makes sense, because the list of providers is the same type of widget, but it's only using the "disable options" feature.
Comparing the HTML code for the widgets in my two client editions (the one from your Docker stack and my local version) it's clear the dropdown with the databases doesn't receive any information about what to disable, the style, anything... it just seems to instantiate the widget and then... die.
I don't see other significant things in the DevTools.
One other thing I just noticed (again, might not be in any way significant) is the presence of lm-Widget
in the classes of all my widgets in the local instance, while the lm-*
class names are not present whatsoever in the widgets for the Docker stack edition. Now, this might simply be a Voilà thing that it adds to the classes. But it might also be a Jupyter versioning / ipywidgets versioning thing. But as you listed the pip
diff above.. well... it's just weird, and maybe just a Voilà -specific thing and doesn't actually have anything to do with this issue.
My reasoning here is that I'm trying to find clues to why the information about disabling and grouping is not getting through to the dropdown widget.
My reasoning here is that I'm trying to find clues to why the information about disabling and grouping is not getting through to the dropdown widget.
How is the information provided in the first place?
In any case. I unfortunately do not have more time to spend on this at this moment. If you want a (possibly) working setup, you can try to do the following:
$ pip install -U pip setuptools wheel
$ pip install optimade-client[dev]
Note, it might be that one needs to first run pip install jupyter
. I'm unsure.
$ optimade-client
and then go to the shown URL to test it out.My reasoning here is that I'm trying to find clues to why the information about disabling and grouping is not getting through to the dropdown widget.
How is the information provided in the first place?
You mean to the widget? Well it's this JS/Python-hybrid schema. I don't remember the exact timing. Whether it's on initialization of the Python object that represents the widget that the grouping is done. I don't think so though. Because the list of options needs to be updated, so this is most likely triggered when the database is chosen and can be found in the Python code. Then when/how the actual HTML is updated should be from the JS. It should be fed a variable from Python that contains a dictionary/JS object, which it then runs through to populate the dropdown options and stylize them.
I was able to follow the code up until roughly here: https://github.com/CasperWA/voila-optimade-client/blob/a013cce2927b96d224b841a7a15004fa51159f10/optimade_client/subwidgets/provider_database.py#L336-L340 and then I get lost. Maybe you can help me understand where exactly the hand-over happens to the JS object?
Sure, we can have a look at some point - possibly next week.
In the mean time, it might be interesting to see whether the issue is with the extension itself or with the implementation in the client.
I.e., see if you can reproduce it by just installing the ipywidgets-extended
package from GitHub. Then you can test it by running the examples/examples.ipynb
notebook :)
In the mean time, it might be interesting to see whether the issue is with the extension itself or with the implementation in the client. I.e., see if you can reproduce it by just installing the
ipywidgets-extended
package from GitHub. Then you can test it by running theexamples/examples.ipynb
notebook :)
I just ran the example and it seems to fail:
@CasperWA Based on my last experiment it seems that the issue is with the extension, would you agree?
@CasperWA Based on my last experiment it seems that the issue is with the extension, would you agree?
Yes indeed. I thought I commented on this, but I must have missed pushing the button. So we should attack this issue on the side of the extension instead: CasperWA/ipywidgets-extended.
@CasperWA Based on my last experiment it seems that the issue is with the extension, would you agree?
Yes indeed. I thought I commented on this, but I must have missed pushing the button. So we should attack this issue on the side of the extension instead: CasperWA/ipywidgets-extended.
@CasperWA Would you mind transferring https://github.com/CasperWA/voila-optimade-client/issues/369 to https://github.com/CasperWA/ipywidgets-extended? I lack permissions to do so.
Auxilliary issue now tracked in #369 .
See issues: aiidalab/aiidalab-qe#135 and aiidalab/aiidalab-qe#134.
Don't allow the application to auto-choose an index of a dropdown that corresponds to a grouping header.