From 8a644d4adb7a9fcbcbf26efda481395a1ba34270 Mon Sep 17 00:00:00 2001 From: Atsushi Togo Date: Fri, 25 Nov 2016 22:23:03 +0900 Subject: [PATCH] Fix parse_disp_yaml to be able to read supercell structure correctly. This problem only affected to the wien2k interface. --- phonopy/file_IO.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/phonopy/file_IO.py b/phonopy/file_IO.py index d898094a..9f007ab0 100644 --- a/phonopy/file_IO.py +++ b/phonopy/file_IO.py @@ -240,8 +240,18 @@ def parse_disp_yaml(filename="disp.yaml", return_cell=False): if return_cell: lattice = dataset['lattice'] - positions = [x['position'] for x in dataset['atoms']] - symbols = [x['symbol'] for x in dataset['atoms']] + if 'points' in dataset: + data_key = 'points' + pos_key = 'coordinates' + elif 'atoms' in dataset: + data_key = 'atoms' + pos_key = 'position' + else: + data_key = None + pos_key = None + + positions = [x[pos_key] for x in dataset[data_key]] + symbols = [x['symbol'] for x in dataset[data_key]] cell = Atoms(cell=lattice, scaled_positions=positions, symbols=symbols,