notebook-molecular-visualization icon indicating copy to clipboard operation
notebook-molecular-visualization copied to clipboard

Orbitals not showing up

Open avirshup opened this issue 8 years ago • 4 comments

This is in the most recent master fb2eee08faca347444dc7bbf85de2d8792ccd6f2 and also MDT. You'll also need to check out the visualization_json branch of MDT, or this will throw an exception because of some bad JSON.

To reproduce:

mol = mdt.from_name('benzene')
mol.set_energy_model(mdt.models.CASSCF, active_electrons=6,
                       active_orbitals=6, state_average=6, basis='sto-3g')
mol.calculate()
mol.draw_orbitals()

Then select an orbital from the dropdown list. This produces: image

But we'd expect orbitals: image

(the UI changes are from upgrading to ipywidgets 6.0beta. Once that project is fully stabilized, we should probably make sure the UI layouts are reasonable)

avirshup avatar Nov 02 '16 23:11 avirshup

This one is really mysterious... It seems that observing changes in the Select ipywidget isn't working. It might be a bug in the beta version of ipywidgets. I'm looking into it...

justinmc avatar Nov 03 '16 22:11 justinmc

The select widgets have always been a little finicky in my experience. It's very weird that it changed to a dropdown, since you can see a different kind of dropdown right above it. You might check if changing it to a ipywidgets.Dropdown would get it working.

EDIT: And yeah, I'm like 70% sure that orbitals were working before upgrading to ipywidgets 6

avirshup avatar Nov 03 '16 22:11 avirshup

That did it. I think it looks and works fine so here's a PR: https://github.com/Autodesk/molecular-design-toolkit/pull/118

justinmc avatar Nov 03 '16 23:11 justinmc

Closing this as https://github.com/Autodesk/molecular-design-toolkit/pull/118 was merged. Also for the record it looks like the ipywidgets people have now fixed the original problem here: https://github.com/ipython/ipywidgets/pull/879. I was unable to confirm though.

justinmc avatar Nov 04 '16 17:11 justinmc