Autodesk / molecular-design-toolkit

Notebook-integrated tools for molecular simulation and visualization
http://moldesign.bionano.autodesk.com
Apache License 2.0
164 stars 37 forks source link

3D viewer windows are black, never render #68

Closed avirshup closed 7 years ago

avirshup commented 7 years ago

I can't consistently reproduce this. It seems to happen when the viewer widget is created but not immediately rendered - often the case with the the viewer that's displayed after we assign a forcefield (below).

This screenshot is from Example 4 in moldesign 0.7.2, using nbmolviz 0.6.6.

image

justinmc commented 7 years ago

I'll look into this. I'm hoping some of these bugs start disappearing as I refactor out the RPC stuff, but we'll see what happens.

avirshup commented 7 years ago

These steps seem to reproduce this reliably (it happens a lot more often, but not reproducibly). I can confirm that this bug is definitely related to evaluating a lot of cells very quickly.

Reliably reproducing is a major pain, though - it actually requires a bug that causes small_molecule.draw() to throw an exception. Here's how I've done it.

In pictures

We're going to try to draw two things: image

To reproduce the bug: run those two cells QUICKLY (hit shift-enter twice very quickly): image

To get the expected result, run them SLOWLY (wait for the first cell to render before hitting shift-enter again): image

Details

This is using MDT commit 7a989b60488600f2a06808922e3157616fc14802 along with Autodesk/notebook-molecular-visualization@3d7bb35285dfba95ed7d27cb86b6a5307660320b

Note that there's a BUG with these commits that's actually important for reproducing this issue ...

First, we'll create two molecules:

import moldesign as mdt
small_molecule = mdt.from_name('butadiene')
protein = mdt.from_pdb('3aid')

Next, we create two cells, one to draw the protein, the other to draw the small_molecule (that will fail due to a bug).

Cell 1: protein.draw() Cell 2: small_molecule.draw() (this will throw an exception due to an unrelated bug)

If you run these two cells very quickly, one after another (hit shift-enter quickly or use Cell:Run cells below); it should produce the black box. Run them slowly and it will render correctly.

justinmc commented 7 years ago

@avirshup Any evidence that this is still happening after the recent refactoring?

avirshup commented 7 years ago

Yes, unfortunately. Will try to put together some sort of a reproducible test case with the current version

justinmc commented 7 years ago

Ok, I'll take a look then. If the above still works to reproduce it more or less then I can use it, don't worry about going through all that again!

avirshup commented 7 years ago

Closing this one for now - pending a complete rethink of widgets and the 3D API