Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript error with show_mdtraj #1124

Closed
VittoriaOssanna opened this issue Nov 7, 2024 · 3 comments
Closed

Javascript error with show_mdtraj #1124

VittoriaOssanna opened this issue Nov 7, 2024 · 3 comments
Assignees
Labels

Comments

@VittoriaOssanna
Copy link

Hello everyone,

I am having troubles in visualizing an mdtraj object with nglview.
The code is very short, I was just running a small experiment:

import nglview
import mdtraj

trr = pathlib.Path('./test00/shots0/path000129.trr')
gro = pathlib.Path('./run.gro')

traj = mdtraj.load(str(trr), top=str(gro))
nglview.show_mdtraj(traj)

But shows me a javascript error that I can not define better

 at ph.loadClass (https://file+.vscode-resource.vscode-cdn.net/home/vittoria/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.19/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4099813)
    at ph.loadClass (https://file+.vscode-resource.vscode-cdn.net/home/vittoria/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.19/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4403287)
    at ph.loadModelClass (https://file+.vscode-resource.vscode-cdn.net/home/vittoria/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.19/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4097773)
    at ph._make_model (https://file+.vscode-resource.vscode-cdn.net/home/vittoria/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.19/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4094616)
    at ph.new_model (https://file+.vscode-resource.vscode-cdn.net/home/vittoria/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.19/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4092246)
    at ph.handle_comm_open (https://file+.vscode-resource.vscode-cdn.net/home/vittoria/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.19/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4091039)
    at https://file+.vscode-resource.vscode-cdn.net/home/vittoria/.vscode/extensions/ms-toolsai.jupyter-renderers-1.0.19/out/node_modules/%40vscode/jupyter-ipywidgets8/dist/ipywidgets.js:2:4402511
    at n._handleCommOpen (https://file+.vscode-resource.vscode-cdn.net/home/vittoria/.vscode/extensions/ms-toolsai.jupyter-2024.9.1-linux-x64/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:3:80955)
    at async n._handleMessage (https://file+.vscode-resource.vscode-cdn.net/home/vittoria/.vscode/extensions/ms-toolsai.jupyter-2024.9.1-linux-x64/dist/webviews/webview-side/ipywidgetsKernel/ipywidgetsKernel.js:3:82830)

I am using

  • nglview version 3.1.2
  • if relevant, the trajectory file is a .trr file produced with gromacs.

Thank you for your support

@hainm hainm self-assigned this Nov 21, 2024
@hainm hainm added the bug label Nov 21, 2024
@hainm
Copy link
Collaborator

hainm commented Nov 21, 2024

Thank you for your report.

@hainm
Copy link
Collaborator

hainm commented Nov 25, 2024

vscode

@VittoriaOssanna oh, versions > 3.0.8 have issue with vscode.
Please use v3.0.8 for now.

@hainm
Copy link
Collaborator

hainm commented Nov 25, 2024

Please try latest version, v3.1.4
pip3 install nglview==3.1.4
(conda version will be released later via conda-forge)

@hainm hainm closed this as completed Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants