From f0e28a88e715a366a4cd9fe07fc6b7f209225c3f Mon Sep 17 00:00:00 2001 From: calvinp0 Date: Sun, 11 Aug 2024 21:19:25 +0000 Subject: [PATCH] deploy: 0bb9d9aae20d4b187dbb01ca0882f0590d2da8c8 --- _modules/arc/parser.html | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/_modules/arc/parser.html b/_modules/arc/parser.html index f7443c950d..f791032802 100644 --- a/_modules/arc/parser.html +++ b/_modules/arc/parser.html @@ -395,11 +395,9 @@

Source code for arc.parser

         raise InputError(f'Could not find file {path}')
     if path.endswith('.yml'):
         content = read_yaml_file(path)
-        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'])
+        for key in ['xyz', 'opt_xyz']:
+            if isinstance(content, dict) and key in content.keys():
+                return content[key] if isinstance(content[key], dict) else str_to_xyz(content[key])
     software = identify_ess(path)
     xyz_str = ''
     if software == 'xtb':
@@ -460,6 +458,10 @@ 

Source code for arc.parser

     """
     if not os.path.isfile(path):
         raise InputError(f'Could not find file {path}')
+    if path.endswith('.yml'):
+        content = read_yaml_file(path)
+        if isinstance(content, dict) and 'T1' in content.keys():
+            return content['T1']
     log = ess_factory(fullpath=path, check_for_errors=False)
     try:
         t1 = log.get_T1_diagnostic()
@@ -519,6 +521,10 @@ 

Source code for arc.parser

         Optional[str]: The ESS.
     """
     software = None
+    if path.endswith('.yml'):
+        content = read_yaml_file(path)
+        if isinstance(content, dict) and 'adapter' in content.keys():
+            return content['adapter']
     with open(path, 'r') as f:
         for _ in range(25):
             line = f.readline()