py4lab and jupyter lab
Moderators: Global Moderator, Moderator
-
- Newbie
- Posts: 13
- Joined: Tue Sep 13, 2022 12:30 pm
py4lab and jupyter lab
Hi,
For some reason plots generated by py4lab within jupyter notebook appear as blank cells. No error message is produced. The plot is generated as per the recipe in py4vasp manual:
import py4vasp as p4v
calc = p4v.Calculation.from_path("./bulk/3_dos")
calc.dos.plot("total,s,p")
Regards.
Gvido
For some reason plots generated by py4lab within jupyter notebook appear as blank cells. No error message is produced. The plot is generated as per the recipe in py4vasp manual:
import py4vasp as p4v
calc = p4v.Calculation.from_path("./bulk/3_dos")
calc.dos.plot("total,s,p")
Regards.
Gvido
-
- Global Moderator
- Posts: 542
- Joined: Fri Nov 08, 2019 7:18 am
Re: py4lab and jupyter lab
Please check if your browser has javascript enabled. You can also try a minimal example of the plotly library
If you find that plotly works but py4vasp does not, we need to figure out why that is the case. If you cannot make plotly work at all, you can try to export the pictures
Code: Select all
# x and y given as array_like objects
import plotly.express as px
fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
fig.show()
Code: Select all
import py4vasp as p4v
calc = p4v.Calculation.from_path("./bulk/3_dos")
calc.dos.to_image("total,s,p")
Martin Schlipf
VASP developer
-
- Newbie
- Posts: 13
- Joined: Tue Sep 13, 2022 12:30 pm
Re: py4lab and jupyter lab
Thanks for the help.
1. Javascript is enabled
2. The minimal example exhibits the same behavior as py4vasp, i.e. blank cell of the size of graph.
I've checked this on Chrome and Safari (OSX 12.6 with latest updates).
I've installed py4vasp via conda within an environment with the necessary packages installed (the list is too long for the post on the forum).
Exporting to image works.
Regards.
Gvido
1. Javascript is enabled
2. The minimal example exhibits the same behavior as py4vasp, i.e. blank cell of the size of graph.
I've checked this on Chrome and Safari (OSX 12.6 with latest updates).
I've installed py4vasp via conda within an environment with the necessary packages installed (the list is too long for the post on the forum).
Exporting to image works.
Regards.
Gvido
-
- Newbie
- Posts: 13
- Joined: Tue Sep 13, 2022 12:30 pm
Re: py4lab and jupyter lab
Solved the problem by reinstalling completely conda and jupyterlab, and installing all packages from conda-forge.
Important: downgrade ipywidgets from 8.02 to 7.7.
Gvido
Important: downgrade ipywidgets from 8.02 to 7.7.
Gvido
-
- Global Moderator
- Posts: 542
- Joined: Fri Nov 08, 2019 7:18 am
Re: py4lab and jupyter lab
Great that it works now.
Perhaps, I should add to the documentation how to install specific versions of py4vasp in the future. In our development environment, we freeze all dependencies to specific versions to avoid these conflicts. The installation is a bit more involved than the simple pip install, but may solve these issues. For the record, we currently use ipywidgets 7.7.1.
Perhaps, I should add to the documentation how to install specific versions of py4vasp in the future. In our development environment, we freeze all dependencies to specific versions to avoid these conflicts. The installation is a bit more involved than the simple pip install, but may solve these issues. For the record, we currently use ipywidgets 7.7.1.
Martin Schlipf
VASP developer