Closed veitveit closed 5 years ago
@veitveit I experienced this as well but thought that it had to do with my setup on my external server.
This definitely is a bug that needs to be resolved. I'll have a look at it.
@veitveit In my tests I found that this happens if the Kernel is already running and the notebook is being reopened. Can you confirm this?
Yes, that was definitely the case. But there might have been other reasons for the widgets to disappear. I will try to reproduce this the next time I encounter this problem
Am Di., 4. Sep. 2018 um 14:39 Uhr schrieb Johannes Griss < notifications@github.com>:
@veitveit https://github.com/veitveit In my tests I found that this happens if the Kernel is already running and the notebook is being reopened. Can you confirm this?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ProtProtocols/IsoLabeledProtocol/issues/69#issuecomment-418351604, or mute the thread https://github.com/notifications/unsubscribe-auth/APEZhV4cpTvuKyulTfdgrCc1MK5Quwhtks5uXnSGgaJpZM4WYYYg .
-- |||/ (o o) ----ooO-(_)-Ooo----
Don't worry about life; you're not going to survive it anyway.
@veitveit After several tests I can reproduce the error consistently by closing the notebook, leaving the kernel running and then opening the notebook again.
it seems that in this case, the init_cell
script is reexecuting the code (as it should) but the python kernel is doing so as well. This seems to lead to ?race conditions which causes the output (ie. all GUI elements) to be created but then deleted again and not re-created.
An ideal solution would probably be to block the init_cell
routine if the GUI elements are already present. But this will require some coding...
@veitveit I've now removed all init_cells but one. This displays a button to trigger the workflow and initializes all other cells. When reopening a notebook connected to a running kernel, the message box that settings were reloaded is displayed twice (no idea why) but the user interface remains visible.
Please test!
@jgriss When running the database search and then opening an additional instance of the notebook, this appears (in the javascript console):
Loading failed for the <script> with source “http://localhost:8888/nbextensions/hide_code/main.js?v=20180905071406”. Isobaric_Workflow.ipynb:1
Failed to load extension:
Array [ "nbextensions/hide_code/main" ]
Error: "Script error for "nbextensions/hide_code/main"
http://requirejs.org/docs/errors.html#scripterror"
@jgriss
And when closing and opening the notebook while running a database search, then I don't get any button. Instead I get the text in the cell:
Button(description='Start Wokflow / Display user interface', layout=Layout(width='30%'), style=ButtonStyle())
Then, after the search is finished, the widgets show again, but not the button you first implemented.
This looks very tricky and probably is dependent on the browser + OS. Your adjustments seem to work and we cannot change the behavior while a cell is running.
I suggest to additionally write that the user should close the notebook and open it again as soon as it finished.
@jgriss What works very well is opening the protocol from a folder which already contains an OUT subfolder with results. Then only the new button shows, so it definitely is needed.
@veitveit
There are a few issues you mentioned here:
So in short, these two scenarios are not really linked to our original issue. I suggest that we
Yes, adding a bit of text will be the solution for now.
The hide_code extension still seems to be maintained, but slowly. So it might be supported again. If there is a better option, let's go for it. I just didn't see anything when I was looking for it.
Seems to work fine now.
Sometimes, even when starting a new image, the widgets do not show. This could be due to already available files in the mapped folder, reloading the notebook, or others.
I see 2 simple possibilities to solve this:
@jgriss What do you think?