From 8413b6c1697daaf27f31e9ba404355fcc3d0f090 Mon Sep 17 00:00:00 2001 From: Kfir Kaplan Date: Thu, 4 May 2023 09:15:45 +0300 Subject: [PATCH] Make sure that parse_xyz returns a dict xyz --- arc/parser.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arc/parser.py b/arc/parser.py index 9efe0a3d84..4aace80259 100644 --- a/arc/parser.py +++ b/arc/parser.py @@ -231,10 +231,11 @@ def parse_geometry(path: str) -> Optional[Dict[str, tuple]]: raise InputError(f'Could not find file {path}') if path.endswith('.yml'): content = read_yaml_file(path) - if isinstance(content, dict) and 'xyz' in content.keys(): - return content['xyz'] - if isinstance(content, dict) and 'opt_xyz' in content.keys(): - return content['opt_xyz'] + if isinstance(content, dict): + if 'xyz' in content.keys(): + return content['xyz'] if isinstance(content['xyz'], dict) else str_to_xyz(content['xyz']) + elif 'opt_xyz' in content.keys(): + return content['opt_xyz'] if isinstance(content['opt_xyz'], dict) else str_to_xyz(content['opt_xyz']) software = identify_ess(path) xyz_str = '' if software == 'xtb':