CMS 3D CMS Logo

Functions | Variables
TablePrint Namespace Reference

Functions

def PrettyPrintTable (Headers, Data, ColWidths, WarningCol=[], border=' *')
 
def PrintHLine (ColWidths, border)
 
def PrintLine (line, ColWidths, Warn, border)
 

Variables

 write
 

Function Documentation

◆ PrettyPrintTable()

def TablePrint.PrettyPrintTable (   Headers,
  Data,
  ColWidths,
  WarningCol = [],
  border = '*' 
)

Definition at line 7 of file TablePrint.py.

References PrintHLine(), PrintLine(), and reco.zip().

Referenced by PrescaleChecker.main().

7 def PrettyPrintTable(Headers,Data,ColWidths,WarningCol=[],border='*'):
8  PrintHLine(ColWidths,border)
9  PrintLine(Headers,ColWidths,False,border)
10  PrintHLine(ColWidths,border)
11  if WarningCol==[]:
12  WarningCol=[False]*len(Data)
13  for [line,Warn] in zip(Data,WarningCol):
14  PrintLine(line,ColWidths,Warn,border)
15  PrintHLine(ColWidths,border)
16 
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float zip(ConstView const &tracks, int32_t i)
Definition: TracksSoA.h:90
def PrintLine(line, ColWidths, Warn, border)
Definition: TablePrint.py:26
def PrettyPrintTable(Headers, Data, ColWidths, WarningCol=[], border=' *')
Definition: TablePrint.py:7
def PrintHLine(ColWidths, border)
Definition: TablePrint.py:17

◆ PrintHLine()

def TablePrint.PrintHLine (   ColWidths,
  border 
)

Definition at line 17 of file TablePrint.py.

References FastTimerService_cff.range, and write.

Referenced by PrettyPrintTable().

17 def PrintHLine(ColWidths,border):
19  for entry in ColWidths:
20  write(border)
21  for i in range(entry):
22  write(border)
23  write(border)
24  write('\n')
25 
def PrintHLine(ColWidths, border)
Definition: TablePrint.py:17

◆ PrintLine()

def TablePrint.PrintLine (   line,
  ColWidths,
  Warn,
  border 
)

Definition at line 26 of file TablePrint.py.

References print(), FastTimerService_cff.range, str, write, and reco.zip().

Referenced by PrettyPrintTable().

26 def PrintLine(line,ColWidths,Warn,border):
27  assert Warn in [True,False]
28  try:
29  assert len(line)==len(ColWidths)
30  except:
31  print(line)
32  print(ColWidths)
33  raise
34  if Warn:
35  write(bcolors.FAIL)
36  for [width, entry] in zip(ColWidths,line):
37  write(border)
38  try:
39  entry = str(entry)
40  except:
41  print("\n\n\n Weird Data .. Bailing out\n\n")
42  sys.exit(0)
43  for i in range(width):
44  if i==0:
45  write(' ')
46  elif i<len(entry)+1:
47  write(entry[i-1])
48  else:
49  write(' ')
50  write(border)
51  write('\n')
52  write(bcolors.ENDC)
53 
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float zip(ConstView const &tracks, int32_t i)
Definition: TracksSoA.h:90
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def PrintLine(line, ColWidths, Warn, border)
Definition: TablePrint.py:26
#define str(s)

Variable Documentation

◆ write

TablePrint.write

Definition at line 5 of file TablePrint.py.

Referenced by PrintHLine(), and PrintLine().