underworld2
underworld2 copied to clipboard
Autocomplete not working in Jupyter notebooks (Docker)
Hi Julian, Romain, et al.,
This may be user error, but I am having trouble with autocompletion when using Jupyter Notebooks in docker. I've tried versions underworldcode/uwgeodynamics:latest and underworldcode/uwgeodynamics:v2.9.5.
Autocompletion works in some cases, but the specific issue I am having is when defining rheologies. I cannot see the rheology names that are available in the library. The readthedocs example shows a drop-down list of options after typing 'rh'. Below is a screenshot in which I added In [12] to Tutorial_1_thermoMechanical_Model.ipynb. After typing 'rh' or 'rh.', tab does nothing. Running a cell with just rh doesn't output meaningful results. How can I see the options available in the rheology library?
Thanks, Peter
Thanks @plovely for reporting this. I will have a look
I can reproduce the issue. Let's see if I can resolve that.
As a temporary workaround, you can access all the options by doing
dir(rh)
Looks like a ipython / jupyter issue
https://github.com/ipython/ipython/issues/12740
Looks like a ipython / jupyter issue
I suppose we could lock down jedi
in the docker for now with
pip install jedi==0.17.2
https://github.com/ipython/ipython/issues/12740#issuecomment-753614077
I have tried that, I think there is something else...
@julesghub There seem to be an issue when overriding both getattr and dir in a class. I have asked the ipython people. Could be a security thing as I can see how this could be used to run maleficent code.
Thanks for working on it so quickly! For now, the dir(rh) workaround gets the job done. Cheers!
I suspect this is related to ipython / Jupyter and may have security reasons... I'll see if I can find a way around.
It's still a pb... We need to fix that...@julesghub