ProtProtocols / IsoProt

Protocol of the analysis of iTRAQ/TMT proteomics data including quantification, statistical analysis and maybe clustering
https://protprotocols.github.io
11 stars 4 forks source link

widgets not always visible #69

Closed veitveit closed 5 years ago

veitveit commented 5 years ago

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?

jgriss commented 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.

jgriss commented 5 years ago

@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?

veitveit commented 5 years ago

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.

http://computproteomics.bmb.sdu.dk

jgriss commented 5 years ago

@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...

jgriss commented 5 years ago

@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!

veitveit commented 5 years ago

@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"
veitveit commented 5 years ago

@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.

veitveit commented 5 years ago

@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.

jgriss commented 5 years ago

@veitveit

There are a few issues you mentioned here:

  1. The hide_code widget is no longer supported for the Jupyter version we use. We'd have to change to different widget that basically offers the same functionality. So this is rather separate.
  2. If you open the Notebook while a search is running the following happens:
    • the search is actually running as part of the Python kernel. So the python kernel is busy.
    • The notebook is waiting for the python kernel to finish / be ready to render new elements
    • If this waiting period is causing a timeout the code simply is not rendered properly
    • So this is caused by Jupyter notebook's design, there's nothing we can change about that. This partly refers to #52 where I am thinking about ways we can display the search progress / output even though the notebook wasn't open. Currently, this output is lost and there is no way to get it.

So in short, these two scenarios are not really linked to our original issue. I suggest that we

veitveit commented 5 years ago

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.

veitveit commented 5 years ago

Seems to work fine now.