CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
valtools.benchmark Class Reference

Public Member Functions

def __init__ (self, arg=None)
 
def __str__ (self)
 
def addLinkToComparison (self, website, comparison)
 
def benchmarkOnWebSite (self, website)
 
def benchmarkUrl (self, website)
 
def exists (self, website)
 
def fullName (self)
 
def makeRelease (self, website)
 
def releaseOnWebSite (self, website)
 
def releaseUrl (self, website)
 
def rootFileOnWebSite (self, website)
 

Public Attributes

 benchmark_
 
 benchmarkWithExt_
 
 indexHtml_
 
 release_
 

Detailed Description

Definition at line 135 of file valtools.py.

Constructor & Destructor Documentation

◆ __init__()

def valtools.benchmark.__init__ (   self,
  arg = None 
)

Definition at line 140 of file valtools.py.

140  def __init__(self, arg=None):
141 
142  release = None
143  benchName = None
144  extension = None
145  self.indexHtml_ = 'index.html'
146 
147  if arg != None:
148  (release, benchName, extension) = decodePath( arg )
149 
150  if release == None:
151  # we get there if:
152  # - arg == None
153  # - the decoding of arg as a full benchmark name has failed.
154  self.release_ = os.environ['CMSSW_VERSION']
155 
156  # benchmark directory, as the current working directory
157  self.benchmark_ = os.path.basename( os.getcwd() )
158 
159  # underscore are not allowed in extension names
160  if arg!=None and arg.count('_'):
161  print('sorry, as said many times, underscores are not allowed in the extension ;P')
162  sys.exit(5)
163 
164  extension = arg
165  else:
166  self.release_ = release
167  self.benchmark_ = benchName
168 
169  self.benchmarkWithExt_ = self.benchmark_
170  if( extension != None ):
171  self.benchmarkWithExt_ = '%s_%s' % (self.benchmark_, extension)
172 
173 

Member Function Documentation

◆ __str__()

def valtools.benchmark.__str__ (   self)

Definition at line 174 of file valtools.py.

174  def __str__(self):
175  return self.release_ + '/' + self.benchmarkWithExt_
176 

References valtools.benchmark.benchmarkWithExt_, and valtools.benchmark.release_.

◆ addLinkToComparison()

def valtools.benchmark.addLinkToComparison (   self,
  website,
  comparison 
)

Definition at line 215 of file valtools.py.

215  def addLinkToComparison( self, website, comparison ):
216  url = comparison.comparisonUrl( website )
217  index = self.benchmarkOnWebSite(website) + '/' + self.indexHtml_
218  indexTmp = self.benchmarkOnWebSite(website) + '/index.tmp.html'
219  indexFile = open( index)
220  indexFileTmp = open( indexTmp, 'w')
221  for line in indexFile:
222  p = re.compile('<h2>Comparisons:</h2>')
223  m = p.match(line)
224  indexFileTmp.write(line)
225  if m:
226  link = '<A href="%s">%s</A><BR>\n' % (url, url)
227  indexFileTmp.write(link)
228  shutil.move( indexTmp, index)
229 

References valtools.benchmark.benchmarkOnWebSite(), and valtools.benchmark.indexHtml_.

◆ benchmarkOnWebSite()

def valtools.benchmark.benchmarkOnWebSite (   self,
  website 
)

Definition at line 183 of file valtools.py.

183  def benchmarkOnWebSite( self, website ):
184  return '%s/%s' % ( website, self.fullName() )
185 # return '%s/%s' % ( self.releaseOnWebSite(website),
186 # self.benchmarkWithExt_ )
187 

References perftools::EdmEventSize::BranchRecord.fullName, DTLocalTriggerBaseTest.fullName(), cms::DDFilteredView.fullName(), and valtools.benchmark.fullName().

Referenced by valtools.benchmark.addLinkToComparison(), valtools.benchmark.exists(), and valtools.benchmark.rootFileOnWebSite().

◆ benchmarkUrl()

def valtools.benchmark.benchmarkUrl (   self,
  website 
)

Definition at line 196 of file valtools.py.

196  def benchmarkUrl( self, website ):
197  return '%s/%s' % ( self.releaseUrl( website ),
198  self.benchmarkWithExt_ )
199 

References valtools.benchmark.benchmarkWithExt_, and valtools.benchmark.releaseUrl().

◆ exists()

def valtools.benchmark.exists (   self,
  website 
)

Definition at line 207 of file valtools.py.

207  def exists( self, website):
208  if( os.path.isdir( self.benchmarkOnWebSite(website) )):
209  print('benchmark %s exists for release %s' % (self.benchmarkWithExt_, self.release_))
210  return True
211  else:
212  print('benchmark %s does not exist for release %s' % (self.benchmarkWithExt_, self.release_))
213  return False
214 

References valtools.benchmark.benchmarkOnWebSite(), valtools.benchmark.benchmarkWithExt_, if(), print(), and valtools.benchmark.release_.

◆ fullName()

def valtools.benchmark.fullName (   self)

Definition at line 177 of file valtools.py.

177  def fullName(self):
178  return self.release_ + '/' + self.benchmarkWithExt_
179 

References valtools.benchmark.benchmarkWithExt_, and valtools.benchmark.release_.

Referenced by valtools.benchmark.benchmarkOnWebSite().

◆ makeRelease()

def valtools.benchmark.makeRelease (   self,
  website 
)

Definition at line 200 of file valtools.py.

200  def makeRelease( self, website):
201  rel = self.releaseOnWebSite(website)
202  if( os.path.isdir( rel )==False):
203  print('creating release %s' % self.release_)
204  print(rel)
205  os.mkdir( rel )
206 

References if(), print(), valtools.benchmark.release_, and valtools.benchmark.releaseOnWebSite().

◆ releaseOnWebSite()

def valtools.benchmark.releaseOnWebSite (   self,
  website 
)

Definition at line 180 of file valtools.py.

180  def releaseOnWebSite( self, website ):
181  return '%s/%s' % ( website, self.release_ )
182 

References valtools.benchmark.release_.

Referenced by valtools.benchmark.makeRelease().

◆ releaseUrl()

def valtools.benchmark.releaseUrl (   self,
  website 
)

Definition at line 192 of file valtools.py.

192  def releaseUrl( self, website ):
193  return '%s/%s' % ( website.url_, self.release_ )
194 
195 

References valtools.benchmark.release_.

Referenced by valtools.benchmark.benchmarkUrl().

◆ rootFileOnWebSite()

def valtools.benchmark.rootFileOnWebSite (   self,
  website 
)

Definition at line 188 of file valtools.py.

188  def rootFileOnWebSite( self, website ):
189  return '%s/%s' % ( self.benchmarkOnWebSite(website),
190  'benchmark.root' )
191 

References valtools.benchmark.benchmarkOnWebSite().

Member Data Documentation

◆ benchmark_

valtools.benchmark.benchmark_

◆ benchmarkWithExt_

valtools.benchmark.benchmarkWithExt_

◆ indexHtml_

valtools.benchmark.indexHtml_

Definition at line 145 of file valtools.py.

Referenced by valtools.benchmark.addLinkToComparison().

◆ release_

valtools.benchmark.release_
if
if(0==first)
Definition: CAHitNtupletGeneratorKernelsImpl.h:48
valtools.decodePath
def decodePath(path)
Definition: valtools.py:275
newFWLiteAna.fullName
fullName
Definition: newFWLiteAna.py:122
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
TriggerAnalyzer.__str__
def __str__(self)
Definition: TriggerAnalyzer.py:103