test
CMS 3D CMS Logo

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

Public Member Functions

def __init__
 
def create
 

Private Attributes

 _possibleDirs
 
 _tableCreator
 

Detailed Description

Definition at line 2159 of file plotting.py.

Constructor & Destructor Documentation

def plotting.PlotterTableItem.__init__ (   self,
  possibleDirs,
  tableCreator 
)

Definition at line 2160 of file plotting.py.

2161  def __init__(self, possibleDirs, tableCreator):
2162  self._possibleDirs = possibleDirs
2163  self._tableCreator = tableCreator

Member Function Documentation

def plotting.PlotterTableItem.create (   self,
  openFiles,
  legendLabels,
  dqmSubFolder 
)

Definition at line 2164 of file plotting.py.

References plotting._getDirectory(), plotting.PlotterItem._possibleDirs, plotting.PlotterTableItem._possibleDirs, and ComparisonHelper.zip().

2165  def create(self, openFiles, legendLabels, dqmSubFolder):
2166  if isinstance(dqmSubFolder, list):
2167  if len(dqmSubFolder) != len(openFiles):
2168  raise Exception("When dqmSubFolder is a list, len(dqmSubFolder) should be len(openFiles), now they are %d and %d" % (len(dqmSubFolder), len(openFiles)))
2169  else:
2170  dqmSubFolder = [dqmSubFolder]*len(openFiles)
2171  dqmSubFolder = [sf.subfolder if sf is not None else None for sf in dqmSubFolder]
2172 
2173  tbl = []
2174  for f, sf in zip(openFiles, dqmSubFolder):
2175  data = None
2176  tdir = _getDirectory(f, self._possibleDirs, sf)
2177  if tdir is not None:
2178  data = self._tableCreator.create(tdir)
2179  tbl.append(data)
2180 
2181  # Check if we have any content
2182  allNones = True
2183  colLen = 0
2184  for col in tbl:
2185  if col is not None:
2186  allNones = False
2187  colLen = len(col)
2188  break
2189  if allNones:
2190  return None
2191 
2192  # Replace all None columns with lists of column length
2193  for i in xrange(len(tbl)):
2194  if tbl[i] is None:
2195  tbl[i] = [None]*colLen
2196 
2197  return html.Table(columnHeaders=legendLabels, rowHeaders=self._tableCreator.headers(), table=tbl,
2198  purpose=self._tableCreator.getPurpose(), page=self._tableCreator.getPage(), section=self._tableCreator.getSection(dqmSubFolder[0]))
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def _getDirectory
Definition: plotting.py:62

Member Data Documentation

plotting.PlotterTableItem._possibleDirs
private

Definition at line 2161 of file plotting.py.

Referenced by plotting.PlotterTableItem.create().

plotting.PlotterTableItem._tableCreator
private

Definition at line 2162 of file plotting.py.