AttributeError: 'Poscar' object has no attribute 'get_string'

Hi

I’ve just installed Atomate2 and I’m trying to run an Atomate2 example (I changed the POTCAR set though):

from atomate2.vasp.jobs.core import RelaxMaker
from jobflow import run_locally
from pymatgen.core import Structure
from atomate2.vasp.powerups import update_user_potcar_functional

construct an FCC silicon structure

si_structure = Structure(
lattice=[[0, 2.73, 2.73], [2.73, 0, 2.73], [2.73, 2.73, 0]],
species=[“Si”, “Si”],
coords=[[0, 0, 0], [0.25, 0.25, 0.25]],
)

make a relax job to optimize the structure

relax_job = RelaxMaker().make(si_structure)
relax_job = update_user_potcar_functional(relax_job, potcar_functional=‘PBE_64’)

run the job

run_locally(relax_job, create_folders=True)

The VASP INCAR and KPOINTS are created successfully, but the code crashes at creation of the POSCAR:

Output while running in the prescribed Atomate2 environment follows:
2024-02-21 16:50:44,155 INFO Started executing jobs locally
2024-02-21 16:50:44,159 INFO Starting job - relax (4597edc4-97f1-41aa-8fee-c0c2cb859793)
2024-02-21 16:50:44,186 INFO relax failed with exception:
Traceback (most recent call last):
File “/data2/home/[email protected]/software/atomate2/env_atomate2/lib/python3.9/site-packages/jobflow/managers/local.py”, line 114, in _run_job
response = job.run(store=store)
File “/data2/home/[email protected]/software/atomate2/env_atomate2/lib/python3.9/site-packages/jobflow/core/job.py”, line 583, in run
response = function(*self.function_args, **self.function_kwargs)
File “/data2/home/[email protected]/software/atomate2/env_atomate2/lib/python3.9/site-packages/atomate2/vasp/jobs/base.py”, line 218, in make
write_vasp_input_set(
File “/data2/home/[email protected]/software/atomate2/env_atomate2/lib/python3.9/site-packages/atomate2/vasp/files.py”, line 202, in write_vasp_input_set
vis.write_input(directory, potcar_spec=potcar_spec, **kwargs)
File “/data2/home/[email protected]/software/atomate2/env_atomate2/lib/python3.9/site-packages/atomate2/vasp/sets/base.py”, line 114, in write_input
f.write(v.get_string(significant_figures=16))
AttributeError: ‘Poscar’ object has no attribute ‘get_string’


Any suggestions as to the cause of this error?

Thanks much
Kirk

Hi @kirklew,

These get_string methods were recently removed from pymatgen (see discussion here). This will be fixed in an upcoming release of atomate 2.

For now, downgrading your version of pymatgen should resolve this:
pip install pymatgen==2023.12.18

That completely solved the issue…VASP inputs were created successfully, VASP job ran successfully, and results were put into MongoDB successfully…great!

Thanks much!
Kirk

1 Like