Skip to content

Commit 67bcebf

Browse files
committed
updated conversion using AseAtomsAdapter
1 parent dcfc13d commit 67bcebf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vsh/scripts/poscar.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ def boxed_molecule(args):
8888
def convert_to_poscar(args):
8989
"""Converts a file to a POSCAR file"""
9090
from pymatgen.io.vasp.inputs import Poscar
91+
from pymatgen.io.ase import AseAtomsAdaptor
9192

92-
structure = read(args.input)
93-
poscar = Poscar(structure, sort_structure=args.sort)
93+
atoms = read(args.input)
94+
poscar = Poscar(AseAtomsAdaptor.get_structure(atoms), sort_structure=args.sort)
9495

9596
if not args.output:
9697
print(poscar.get_str())
@@ -196,7 +197,7 @@ def calculate_rdf(coordinates, bins=1000, r_max=None):
196197
- bin_centers: centers of the bins.
197198
- rdf: radial distribution function.
198199
"""
199-
200+
200201
if r_max is None:
201202
r_max = np.max(np.linalg.norm(coordinates - coordinates[0], axis=1))
202203

0 commit comments

Comments
 (0)