pyiron/pyiron_atomistics

VASP parser and non uniform arrays are not working with latest python version

Closed this issue · 6 comments

Hi Guys,

there is a problem with the compatibility of the numpy and python versions currently on the cluster.

You can't have 2d arrays where arrays along the first dimension have different sizes: x = np.array([[1,3], [4]]). This was warned before as being deprecated in previous versions but now it just gives an error: ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

Now the problem is that the vasp parser does this a lot. For instance, when the magnetization is being parsed where it tries to parse the magnetization during each scf (dimension 0) for each ionic relaxation (dimension 1), dimension 0 have different length for each scf. When it was a warning, collect_output() worked fine, now any vasp magnetic calculation will be aborted from pyiron side even though it is finished normally. running collect_output() manually also dont work.

Somehow, the conda package doesn't set the dependency on numpy version <=1.24.3 correctly, so during the last conda update on the cluster, numpy was upgraded to 1.24.4. We've downgraded to 1.24.3, so things there should be working again.
On compatibility with numpy 1.25.1 is worked on in pyiron/pyiron_base#1159 .

pmrv commented

Actually maybe good to keep this open to track the problems VASP has specifically. @ahmedabdelkawy Once you have the old jobs loaded again, can you post here which arrays are ragged in the VASP output?

It is: magnetization = np.array(self.outcar.parse_dict["magnetization"]).copy()

This is a code to reproduce the problem

from pyiron import Project
import numpy as np

pr = Project('fe')

vasp_job = pr.create.job.Vasp('Fe_magnetic', delete_existing_job=True)
vasp_job.structure = pr.create.structure.bulk('Fe', 'bcc', a=2.8, cubic=True)
vasp_job.set_encut(450)
vasp_job.set_kpoints([10,10,10])
vasp_job.input.incar["ISPIN"]=2 
vasp_job.input.incar["ALGO"]="Normal"
vasp_job.calc_minimize()
vasp_job.input.incar["ISIF"] = "3"
vasp_job.input.incar["IBRION"] = "1"
vasp_job.input.incar["MAGMOM"]= "5 5"
vasp_job.input.incar["NCORE"] = '1'
vasp_job.executable = '5.4.4'
vasp_job.server.cores = 5
vasp_job.status.collect = True
vasp_job.run(delete_existing_job=True, run_mode='queue')
vasp_job.collect_output()

This is an OUTCAR ( OUTCAR.txt) to test the problem

This was now fixed by #1200