ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
python.trfValidation.ignorePatterns Class Reference

Class of patterns that can be ignored from athena logfiles. More...

Inheritance diagram for python.trfValidation.ignorePatterns:
Collaboration diagram for python.trfValidation.ignorePatterns:

Public Member Functions

def __init__ (self, files=['atlas_error_mask.db'], extraSearch=[])
 Load error patterns from files. More...
 
def structuredPatterns (self)
 
def searchPatterns (self)
 

Private Member Functions

def _initalisePatterns (self, files)
 
def _initialiseSerches (self, searchStrings=[])
 

Private Attributes

 _structuredPatterns
 
 _searchPatterns
 

Detailed Description

Class of patterns that can be ignored from athena logfiles.

Definition at line 100 of file trfValidation.py.

Constructor & Destructor Documentation

◆ __init__()

def python.trfValidation.ignorePatterns.__init__ (   self,
  files = ['atlas_error_mask.db'],
  extraSearch = [] 
)

Load error patterns from files.

Load regular expressions to be used in logfile parsing Files to load up structured error patterns from

Parameters
extraSearchExtra regexp strings to search against

Definition at line 106 of file trfValidation.py.

106  def __init__(self, files=['atlas_error_mask.db'], extraSearch = []):
107  # Setup structured search patterns
108  self._structuredPatterns = []
109  self._initalisePatterns(files)
110 
111  # Setup extra search patterns
112  self._searchPatterns = []
113  self._initialiseSerches(extraSearch)
114 

Member Function Documentation

◆ _initalisePatterns()

def python.trfValidation.ignorePatterns._initalisePatterns (   self,
  files 
)
private

Definition at line 123 of file trfValidation.py.

123  def _initalisePatterns(self, files):
124  for patternFile in files:
125  if patternFile == "None":
126  continue
127  fullName = trfUtils.findFile(os.environ['DATAPATH'], patternFile)
128  if not fullName:
129  msg.warning('Error pattern file {0} could not be found in DATAPATH'.format(patternFile))
130  continue
131  try:
132  with open(fullName) as patternFileHandle:
133  msg.debug('Opened error file {0} from here: {1}'.format(patternFile, fullName))
134 
135  for line in patternFileHandle:
136  line = line.strip()
137  if line.startswith('#') or line == '':
138  continue
139  try:
140  # N.B. At the moment release matching is not supported!
141  (who, level, message) = [ s.strip() for s in line.split(',', 2) ]
142  if who == "":
143  # Blank means match anything, so make it so...
144  who = "."
145  reWho = re.compile(who)
146  reMessage = re.compile(message)
147  except ValueError:
148  msg.warning('Could not parse this line as a valid error pattern: {0}'.format(line))
149  continue
150  except re.error as e:
151  msg.warning('Could not parse valid regexp from {0}: {1}'.format(message, e))
152  continue
153 
154  msg.debug('Successfully parsed: who={0}, level={1}, message={2}'.format(who, level, message))
155 
156  self._structuredPatterns.append({'service': reWho, 'level': level, 'message': reMessage})
157 
158  except OSError as xxx_todo_changeme:
159  (errno, errMsg) = xxx_todo_changeme.args
160  msg.warning('Failed to open error pattern file {0}: {1} ({2})'.format(fullName, errMsg, errno))
161 
162 

◆ _initialiseSerches()

def python.trfValidation.ignorePatterns._initialiseSerches (   self,
  searchStrings = [] 
)
private

Definition at line 163 of file trfValidation.py.

163  def _initialiseSerches(self, searchStrings=[]):
164  for string in searchStrings:
165  try:
166  self._searchPatterns.append(re.compile(string))
167  msg.debug('Successfully parsed additional logfile search string: {0}'.format(string))
168  except re.error as e:
169  msg.warning('Could not parse valid regexp from {0}: {1}'.format(string, e))
170 
171 
172 

◆ searchPatterns()

def python.trfValidation.ignorePatterns.searchPatterns (   self)

Definition at line 120 of file trfValidation.py.

120  def searchPatterns(self):
121  return self._searchPatterns
122 

◆ structuredPatterns()

def python.trfValidation.ignorePatterns.structuredPatterns (   self)

Definition at line 116 of file trfValidation.py.

116  def structuredPatterns(self):
117  return self._structuredPatterns
118 

Member Data Documentation

◆ _searchPatterns

python.trfValidation.ignorePatterns._searchPatterns
private

Definition at line 112 of file trfValidation.py.

◆ _structuredPatterns

python.trfValidation.ignorePatterns._structuredPatterns
private

Definition at line 108 of file trfValidation.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::open
@ open
Definition: BinningType.h:40