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 134 of file valtools.py.

Constructor & Destructor Documentation

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

Definition at line 139 of file valtools.py.

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

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

Definition at line 214 of file valtools.py.

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

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

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

Definition at line 195 of file valtools.py.

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

195  def benchmarkUrl( self, website ):
196  return '%s/%s' % ( self.releaseUrl( website ),
197  self.benchmarkWithExt_ )
198 
def releaseUrl(self, website)
Definition: valtools.py:191
def benchmarkUrl(self, website)
Definition: valtools.py:195
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_.

206  def exists( self, website):
207  if( os.path.isdir( self.benchmarkOnWebSite(website) )):
208  print 'benchmark %s exists for release %s' % (self.benchmarkWithExt_, self.release_)
209  return True
210  else:
211  print 'benchmark %s does not exist for release %s' % (self.benchmarkWithExt_, self.release_)
212  return False
213 
def exists(self, website)
Definition: valtools.py:206
def benchmarkOnWebSite(self, website)
Definition: valtools.py:182
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().

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

Definition at line 199 of file valtools.py.

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

199  def makeRelease( self, website):
200  rel = self.releaseOnWebSite(website)
201  if( os.path.isdir( rel )==False):
202  print 'creating release %s' % self.release_
203  print rel
204  os.mkdir( rel )
205 
def releaseOnWebSite(self, website)
Definition: valtools.py:179
if(dp >Float(M_PI)) dp-
def makeRelease(self, website)
Definition: valtools.py:199
def valtools.benchmark.releaseOnWebSite (   self,
  website 
)

Definition at line 179 of file valtools.py.

References valtools.benchmark.release_.

Referenced by valtools.benchmark.makeRelease().

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

Definition at line 191 of file valtools.py.

References valtools.benchmark.release_.

Referenced by valtools.benchmark.benchmarkUrl().

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

Definition at line 187 of file valtools.py.

References valtools.benchmark.benchmarkOnWebSite().

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

Member Data Documentation

valtools.benchmark.benchmark_

Definition at line 156 of file valtools.py.

valtools.benchmark.benchmarkWithExt_
valtools.benchmark.indexHtml_

Definition at line 144 of file valtools.py.

Referenced by valtools.benchmark.addLinkToComparison().

valtools.benchmark.release_