Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-11 08:41:05

0001 # Licensed under the Apache License, Version 2.0 (the "License");
0002 # you may not use this file except in compliance with the License.
0003 # You may obtain a copy of the License at
0004 # http://www.apache.org/licenses/LICENSE-2.0
0005 #
0006 # Authors:
0007 # - Paul Nilsson, paul.nilsson@cern.ch, 2021
0008 
0009 #import re
0010 
0011 #import logging
0012 
0013 #logger = logging.getLogger(__name__)
0014 
0015 
0016 def jobparams_prefiltering(value):
0017     """
0018     Perform pre-filtering of raw job parameters to avoid problems with especially quotation marks.
0019     The function can extract some fields from the job parameters to be put back later after actual filtering.
0020 
0021     E.g. ' --athenaopts "HITtoRDO:--nprocs=$ATHENA_CORE_NUMBER" ' will otherwise become
0022     ' --athenaopts 'HITtoRDO:--nprocs=$ATHENA_CORE_NUMBER' ' which will prevent the environmental variable to be unfolded.
0023 
0024     :param value: job parameters (string).
0025     :return: list of fields excluded from job parameters (list), updated job parameters (string).
0026     """
0027 
0028     exclusions = {}
0029 
0030     # Add regex patterns here
0031 
0032     return exclusions, value
0033 
0034 
0035 def jobparams_postfiltering(value, exclusions={}):
0036     """
0037     Perform post-filtering of raw job parameters.
0038     Any items in the optional exclusion list will be added (space separated) at the end of the job parameters.
0039 
0040     :param value: job parameters (string).
0041     :param optional exclusions: exlusions dictionary from pre-filtering function (dictionary).
0042     :return: updated job parameters (string).
0043     """
0044 
0045     return value