CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
models.RegExp Class Reference
Inheritance diagram for models.RegExp:

Public Member Functions

def __init__ (self, regexp)
 
def apply (self)
 
def get_regexp (self)
 

Public Attributes

 database_type
 

Private Attributes

 _regexp
 

Detailed Description

Used to tell proxy methods that a regular expression should be used to query the column.

Definition at line 132 of file models.py.

Constructor & Destructor Documentation

◆ __init__()

def models.RegExp.__init__ (   self,
  regexp 
)

Definition at line 136 of file models.py.

136  def __init__(self, regexp):
137  self._regexp = regexp
138 

Member Function Documentation

◆ apply()

def models.RegExp.apply (   self)

Definition at line 142 of file models.py.

142  def apply(self):
143  # uses code from conddb tool
144  if self.database_type in ["oracle", "frontier"]:
145  return sqlalchemy.func.regexp_like(field, regexp)
146  elif self.database_type == "sqlite":
147  # Relies on being a SingletonThreadPool
148  self.connection_object.engine.pool.connect().create_function('regexp', 2, lambda data, regexp: re.search(regexp, data) is not None)
149 
150  return sqlalchemy.func.regexp(field, regexp)
151  else:
152  raise NotImplemented("Can only apply regular expression search to Oracle, Frontier and SQLite.")
153 

References models.RegExp.database_type.

Referenced by heavyIonTools.ConfigureHeavyIons.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), runJetUncertainties.RunJetUncertainties.__call__(), metTools.AddMETCollection.__call__(), heavyIonTools.ProductionDefaults.__call__(), cmsswVersionTools.PickRelValInputFiles.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties.__call__(), heavyIonTools.SelectionDefaults.__call__(), heavyIonTools.DisbaleMonteCarloDeps.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), tauTools.AddTauCollection.__call__(), trackTools.MakeTrackCandidates.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetCollection.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.UpdateJetCollection.__call__(), jetTools.AddJetID.__call__(), and jetTools.SetTagInfos.__call__().

◆ get_regexp()

def models.RegExp.get_regexp (   self)

Definition at line 139 of file models.py.

139  def get_regexp(self):
140  return self._regexp
141 

References models.RegExp._regexp.

Member Data Documentation

◆ _regexp

models.RegExp._regexp
private

Definition at line 137 of file models.py.

Referenced by models.RegExp.get_regexp().

◆ database_type

models.RegExp.database_type

Definition at line 146 of file models.py.

Referenced by models.RegExp.apply().

apply
Vec apply(Vec v, F f)
Definition: ExtVec.h:81