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

structure plot function not work #143

Open
tuheihei opened this issue Feb 26, 2024 · 5 comments
Open

structure plot function not work #143

tuheihei opened this issue Feb 26, 2024 · 5 comments

Comments

@tuheihei
Copy link

Hi,
When I use the calculation.structure.plot to plot the CONTCAR or POSCAR, it gives out NGLWidget() but not a 3D view of a structure.
Any help would be appreciated.
Yi

@martin-schlipf
Copy link
Collaborator

Do you execute the code in a Jupyter notebook? Visualizing the structure requires a browser window.

@tuheihei
Copy link
Author

tuheihei commented Feb 26, 2024

Do you execute the code in a Jupyter Notebook? Visualizing the structure requires a browser window.

Thanks for the quick follow-up.
Yes, the code was run in a Jupyter Notebook on a m1 MacBook. Other functions, including "dos.plot()" and "structure.print()", worked, while that of "structure.plot" malfunctioned, it read "NGLWidget()" or, sometimes, "NGLWidget(max_frame = 499).
Any advice would be greatly appreciated.

@martin-schlipf
Copy link
Collaborator

Can you try

import nglview
nglview.demo()

to see whether the issue is with NGL or the py4vasp wrapper?

@tuheihei
Copy link
Author

Can you try

import nglview
nglview.demo()

to see whether the issue is with NGL or the py4vasp wrapper?
It returns"NGLWidget()"
The issue indeed seems to be relative to NGL.
So what can I do to fix this?
Thanks

Screenshot 2024-02-27 at 10 30 24

@martin-schlipf
Copy link
Collaborator

Okay, I will suggest a couple of more things you can try but if none of them work, I would suggest to post this in the nglview Github page.

  • If you have not done so already, you can try to install py4vasp or nglview in a clean virtual environment. Please see here for how to do that and then install py4vasp within.
  • Please check that the notebook you use is trusted; otherwise sometimes the execution of javascript code is blocked.
  • Run the same code in a new notebook to make sure there is no state in the current notebook that causes this.
  • Check whether any of the recommendations in the nglview repository work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants