notebook-molecular-visualization
notebook-molecular-visualization copied to clipboard
Orbitals not showing up
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:
But we'd expect orbitals:
(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)
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...
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
That did it. I think it looks and works fine so here's a PR: https://github.com/Autodesk/molecular-design-toolkit/pull/118
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.