CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
plotting.PlotterTableItem Class Reference

Public Member Functions

def __init__ (self, possibleDirs, tableCreator)
 
def create (self, openFiles, legendLabels, dqmSubFolder)
 

Private Attributes

 _possibleDirs
 
 _tableCreator
 

Detailed Description

Definition at line 2728 of file plotting.py.

Constructor & Destructor Documentation

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

Definition at line 2729 of file plotting.py.

2729  def __init__(self, possibleDirs, tableCreator):
2730  self._possibleDirs = possibleDirs
2731  self._tableCreator = tableCreator
2732 
def __init__(self, possibleDirs, tableCreator)
Definition: plotting.py:2729

Member Function Documentation

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

Definition at line 2733 of file plotting.py.

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

2733  def create(self, openFiles, legendLabels, dqmSubFolder):
2734  if isinstance(dqmSubFolder, list):
2735  if len(dqmSubFolder) != len(openFiles):
2736  raise Exception("When dqmSubFolder is a list, len(dqmSubFolder) should be len(openFiles), now they are %d and %d" % (len(dqmSubFolder), len(openFiles)))
2737  else:
2738  dqmSubFolder = [dqmSubFolder]*len(openFiles)
2739  dqmSubFolder = [sf.subfolder if sf is not None else None for sf in dqmSubFolder]
2740 
2741  tbl = []
2742  for f, sf in zip(openFiles, dqmSubFolder):
2743  data = None
2744  tdir = _getDirectory(f, self._possibleDirs, sf)
2745  if tdir is not None:
2746  data = self._tableCreator.create(tdir)
2747  tbl.append(data)
2748 
2749  # Check if we have any content
2750  allNones = True
2751  colLen = 0
2752  for col in tbl:
2753  if col is not None:
2754  allNones = False
2755  colLen = len(col)
2756  break
2757  if allNones:
2758  return None
2759 
2760  # Replace all None columns with lists of column length
2761  for i in xrange(len(tbl)):
2762  if tbl[i] is None:
2763  tbl[i] = [None]*colLen
2764 
2765  return html.Table(columnHeaders=legendLabels, rowHeaders=self._tableCreator.headers(), table=tbl,
2766  purpose=self._tableCreator.getPurpose(), page=self._tableCreator.getPage(), section=self._tableCreator.getSection(dqmSubFolder[0]))
2767 
def create(self, openFiles, legendLabels, dqmSubFolder)
Definition: plotting.py:2733
def _getDirectory(args, kwargs)
Definition: plotting.py:93
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)

Member Data Documentation

plotting.PlotterTableItem._possibleDirs
private

Definition at line 2730 of file plotting.py.

Referenced by plotting.PlotterTableItem.create().

plotting.PlotterTableItem._tableCreator
private

Definition at line 2731 of file plotting.py.