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

Constructor & Destructor Documentation

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

Definition at line 2915 of file plotting.py.

2915  def __init__(self, possibleDirs, tableCreator):
2916  self._possibleDirs = possibleDirs
2917  self._tableCreator = tableCreator
2918 
def __init__(self, possibleDirs, tableCreator)
Definition: plotting.py:2915

Member Function Documentation

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

Definition at line 2919 of file plotting.py.

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

2919  def create(self, openFiles, legendLabels, dqmSubFolder):
2920  if isinstance(dqmSubFolder, list):
2921  if len(dqmSubFolder) != len(openFiles):
2922  raise Exception("When dqmSubFolder is a list, len(dqmSubFolder) should be len(openFiles), now they are %d and %d" % (len(dqmSubFolder), len(openFiles)))
2923  else:
2924  dqmSubFolder = [dqmSubFolder]*len(openFiles)
2925  dqmSubFolder = [sf.subfolder if sf is not None else None for sf in dqmSubFolder]
2926 
2927  tbl = []
2928  for f, sf in zip(openFiles, dqmSubFolder):
2929  data = None
2930  tdir = _getDirectory(f, self._possibleDirs, sf)
2931  if tdir is not None:
2932  data = self._tableCreator.create(tdir)
2933  tbl.append(data)
2934 
2935  # Check if we have any content
2936  allNones = True
2937  colLen = 0
2938  for col in tbl:
2939  if col is not None:
2940  allNones = False
2941  colLen = len(col)
2942  break
2943  if allNones:
2944  return None
2945 
2946  # Replace all None columns with lists of column length
2947  for i in xrange(len(tbl)):
2948  if tbl[i] is None:
2949  tbl[i] = [None]*colLen
2950 
2951  return html.Table(columnHeaders=legendLabels, rowHeaders=self._tableCreator.headers(), table=tbl,
2952  purpose=self._tableCreator.getPurpose(), page=self._tableCreator.getPage(), section=self._tableCreator.getSection(dqmSubFolder[0]))
2953 
def create(self, openFiles, legendLabels, dqmSubFolder)
Definition: plotting.py:2919
def _getDirectory(args, kwargs)
Definition: plotting.py:95
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)

Member Data Documentation

plotting.PlotterTableItem._possibleDirs
private

Definition at line 2916 of file plotting.py.

Referenced by plotting.PlotterTableItem.create().

plotting.PlotterTableItem._tableCreator
private

Definition at line 2917 of file plotting.py.