@@ -3291,30 +3291,33 @@ def get_mainfile_keys(self, **kwargs):
32913291 filepath = kwargs .get ('filename' )
32923292 basename = os .path .basename (filepath )
32933293 gs_file = 'INFO.OUT' in basename
3294- # parse xs for screening files if ground state file is missing
3295- no_gs_file = re .match (r'INFO_SCR.OUT.*' , basename ) and not get_files (
3296- 'INFO.OUT' , filepath
3297- )
3294+ if re .match (r'INFO_SCR.OUT.*' , basename ):
3295+ # do not parse screening files
3296+ return False
32983297
32993298 dirname = os .path .dirname (filepath )
3300- if os .path .isfile (os .path .join (dirname , f'GW_{ basename } ' )):
3299+ if os .path .isfile (os .path .join (dirname , f'GW_{ basename } ' )) and gs_file :
33013300 return ['GW' , 'GW_workflow' ]
33023301
33033302 xs_files = get_files ('*INFOXS*.OUT*' , filepath , 'INFO.OUT' )
3304- if xs_files and (gs_file or no_gs_file ):
3303+ # parse xs for screening files if ground state file is missing
3304+ no_gs_file = len (get_files ('INFO.OUT' , filepath )) == 0
3305+ print ('NNN' , no_gs_file , basename )
3306+ if (xs_files and gs_file ) or ('INFOXS.OUT' in basename and no_gs_file ):
33053307 re_xs_mainfile = re .compile (r'.+\d\d\d\.OUT' )
33063308 spectra_files = []
33073309 for prefix in self ._xs_spectra_types :
33083310 spectra_files = get_files (f'{ prefix } _*.OUT' , filepath , 'INFO.OUT' )
33093311 if spectra_files :
33103312 # remove files for qpoints other than first
3311- files = ['XS_workflow' ] + xs_files
3313+ files = ( ['XS_workflow' ] + xs_files ) if gs_file else []
33123314 for f in spectra_files :
33133315 if re_xs_mainfile .match (f ):
33143316 if '001' in f :
33153317 files .append (f )
33163318 else :
33173319 files .append (f )
3320+ print ('FFFF' , files )
33183321 return files
33193322 return True
33203323
@@ -3407,5 +3410,5 @@ def parse(self, filepath, archive, logger, **kwargs):
34073410 if xs_workflow_archive :
34083411 try :
34093412 self .parse_xs_workflow (xs_archives , xs_workflow_archive )
3410- except Exception :
3411- self .logger .error ('Error parsing the automatic XS workflow' )
3413+ except Exception as e :
3414+ self .logger .error (f 'Error parsing the automatic XS workflow { e } ' )
0 commit comments