Skip to content

Commit a56b0df

Browse files
authored
Make sure that parse_xyz returns a dict xyz (#650)
2 parents 6e1334e + 8413b6c commit a56b0df

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arc/parser.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,11 @@ def parse_geometry(path: str) -> Optional[Dict[str, tuple]]:
231231
raise InputError(f'Could not find file {path}')
232232
if path.endswith('.yml'):
233233
content = read_yaml_file(path)
234-
if isinstance(content, dict) and 'xyz' in content.keys():
235-
return content['xyz']
236-
if isinstance(content, dict) and 'opt_xyz' in content.keys():
237-
return content['opt_xyz']
234+
if isinstance(content, dict):
235+
if 'xyz' in content.keys():
236+
return content['xyz'] if isinstance(content['xyz'], dict) else str_to_xyz(content['xyz'])
237+
elif 'opt_xyz' in content.keys():
238+
return content['opt_xyz'] if isinstance(content['opt_xyz'], dict) else str_to_xyz(content['opt_xyz'])
238239
software = identify_ess(path)
239240
xyz_str = ''
240241
if software == 'xtb':

0 commit comments

Comments
 (0)