CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
valtools.benchmark Class Reference

Public Member Functions

def __init__
 
def __str__
 
def addLinkToComparison
 
def benchmarkOnWebSite
 
def benchmarkUrl
 
def exists
 
def fullName
 
def makeRelease
 
def releaseOnWebSite
 
def releaseUrl
 
def rootFileOnWebSite
 

Public Attributes

 benchmark_
 
 benchmarkWithExt_
 
 indexHtml_
 
 release_
 

Detailed Description

Definition at line 134 of file valtools.py.

Constructor & Destructor Documentation

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

Definition at line 139 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
169  self.benchmarkWithExt_ = self.benchmark_
170  if( extension != None ):
171  self.benchmarkWithExt_ = '%s_%s' % (self.benchmark_, extension)
172 
def decodePath
Definition: valtools.py:274
if(dp >Float(M_PI)) dp-

Member Function Documentation

def valtools.benchmark.__str__ (   self)

Definition at line 173 of file valtools.py.

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

174  def __str__(self):
175  return self.release_ + '/' + self.benchmarkWithExt_
def valtools.benchmark.addLinkToComparison (   self,
  website,
  comparison 
)

Definition at line 214 of file valtools.py.

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

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)
def valtools.benchmark.benchmarkOnWebSite (   self,
  website 
)

Definition at line 182 of file valtools.py.

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

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

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

Definition at line 195 of file valtools.py.

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

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

Definition at line 206 of file valtools.py.

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

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
if(dp >Float(M_PI)) dp-
def valtools.benchmark.fullName (   self)

Definition at line 176 of file valtools.py.

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

Referenced by valtools.benchmark.benchmarkOnWebSite().

177  def fullName(self):
178  return self.release_ + '/' + self.benchmarkWithExt_
def valtools.benchmark.makeRelease (   self,
  website 
)

Definition at line 199 of file valtools.py.

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

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 )
if(dp >Float(M_PI)) dp-
def valtools.benchmark.releaseOnWebSite (   self,
  website 
)

Definition at line 179 of file valtools.py.

References valtools.benchmark.release_.

Referenced by valtools.benchmark.makeRelease().

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

Definition at line 191 of file valtools.py.

References valtools.benchmark.release_.

Referenced by valtools.benchmark.benchmarkUrl().

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

Definition at line 187 of file valtools.py.

References valtools.benchmark.benchmarkOnWebSite().

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

Member Data Documentation

valtools.benchmark.benchmark_

Definition at line 156 of file valtools.py.

valtools.benchmark.benchmarkWithExt_

Definition at line 168 of file valtools.py.

Referenced by valtools.benchmark.__str__(), valtools.benchmark.benchmarkUrl(), valtools.benchmark.exists(), and valtools.benchmark.fullName().

valtools.benchmark.indexHtml_

Definition at line 144 of file valtools.py.

Referenced by valtools.benchmark.addLinkToComparison().

valtools.benchmark.release_

Definition at line 153 of file valtools.py.

Referenced by valtools.benchmark.__str__(), valtools.benchmark.exists(), valtools.benchmark.fullName(), valtools.benchmark.makeRelease(), valtools.benchmark.releaseOnWebSite(), and valtools.benchmark.releaseUrl().