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 2718 of file plotting.py.

Constructor & Destructor Documentation

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

Definition at line 2719 of file plotting.py.

2720  def __init__(self, possibleDirs, tableCreator):
2721  self._possibleDirs = possibleDirs
2722  self._tableCreator = tableCreator

Member Function Documentation

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

Definition at line 2723 of file plotting.py.

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

2724  def create(self, openFiles, legendLabels, dqmSubFolder):
2725  if isinstance(dqmSubFolder, list):
2726  if len(dqmSubFolder) != len(openFiles):
2727  raise Exception("When dqmSubFolder is a list, len(dqmSubFolder) should be len(openFiles), now they are %d and %d" % (len(dqmSubFolder), len(openFiles)))
2728  else:
2729  dqmSubFolder = [dqmSubFolder]*len(openFiles)
2730  dqmSubFolder = [sf.subfolder if sf is not None else None for sf in dqmSubFolder]
2731 
2732  tbl = []
2733  for f, sf in zip(openFiles, dqmSubFolder):
2734  data = None
2735  tdir = _getDirectory(f, self._possibleDirs, sf)
2736  if tdir is not None:
2737  data = self._tableCreator.create(tdir)
2738  tbl.append(data)
2739 
2740  # Check if we have any content
2741  allNones = True
2742  colLen = 0
2743  for col in tbl:
2744  if col is not None:
2745  allNones = False
2746  colLen = len(col)
2747  break
2748  if allNones:
2749  return None
2750 
2751  # Replace all None columns with lists of column length
2752  for i in xrange(len(tbl)):
2753  if tbl[i] is None:
2754  tbl[i] = [None]*colLen
2755 
2756  return html.Table(columnHeaders=legendLabels, rowHeaders=self._tableCreator.headers(), table=tbl,
2757  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:93

Member Data Documentation

plotting.PlotterTableItem._possibleDirs
private

Definition at line 2720 of file plotting.py.

Referenced by plotting.PlotterTableItem.create().

plotting.PlotterTableItem._tableCreator
private

Definition at line 2721 of file plotting.py.