py4vasp (problem with 'plot' from 'py4vasp' )

Problems running VASP: crashes, internal errors, "wrong" results.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
rfaccio
Newbie
Newbie
Posts: 4
Joined: Tue May 22, 2012 11:33 pm
License Nr.: 5-1270

py4vasp (problem with 'plot' from 'py4vasp' )

#1 Post by rfaccio » Fri Jan 13, 2023 9:59 pm

Dear all
Sorry to bother you with a python problem, but I haven't been able to fix it and I really need to use "plot" from py4vasp.
The problem is the following, when importing plot from py4vasp, for example:
import numpy as np
from py4vasp import plot

t1, beef = np.loadtxt("./BEEF.dat",
usecols=[1,3], unpack=True)

plot(t1, beef,
xlabel="Time step",
ylabel="Bayesian error",
title="Bayesian error estimate of forces (max) (eV Angst^-1)"
ImportError: cannot import name 'plot' from 'py4vasp' (/opt/intel/oneapi/intelpython/latest/lib/python3.7/site-packages/py4vasp/__init__.py)


Y tried several installations (e.g.: fresh or inclusive under virtual-env) in different nodes (Ubuntu 20.04.4 LTS) but the same problem occurs.
Any hint?
Best
Ricardo Faccio

rfaccio
Newbie
Newbie
Posts: 4
Joined: Tue May 22, 2012 11:33 pm
License Nr.: 5-1270

Re: py4vasp (problem with 'plot' from 'py4vasp' )

#2 Post by rfaccio » Sat Jan 14, 2023 5:33 pm

Dear all
I found the error, searching in the Vaspwiki the solution is to use plotly instead of plot from py4vasp:
import plotly.express as px
Now it works.
Sorry and thanks again.
Best
Ricardo
----------------------
Dr. Ricardo Faccio
Prof. Titular de Física Gr. 5 (Full Professor)

Av. Gral. Flores 2124. CC 1157. CP 11800. Montevideo. Uruguay
Phone: + 598 2 924 9859
Fax: + 598 2 924 1906
Web: http://cryssmat.fq.edu.uy/ricardo/ricardo.htm

andreas.singraber
Global Moderator
Global Moderator
Posts: 236
Joined: Mon Apr 26, 2021 7:40 am

Re: py4vasp (problem with 'plot' from 'py4vasp' )

#3 Post by andreas.singraber » Mon Jan 16, 2023 8:41 am

Hello!

Indeed py4vasp relies on plotly (currently version 5.9.0) for generating plots, it is one of its requirements. Glad you already found the problem, thanks for posting an update!

Best,
Andreas Singraber

Post Reply