Belle II Software development
ModuleStatistics Class Reference

Public Member Functions

def __init__ (self, stats, categories)
 
def __getitem__ (self, item)
 

Static Public Member Functions

def get_dict (function, categories)
 

Public Attributes

 name
 Name property.
 
 time_sum
 Time sum property.
 
 time_mean
 Time mean property.
 
 time_stddev
 Time std property.
 
 memory_sum
 Memory sum property.
 
 memory_mean
 Memory mean property.
 
 memory_stddev
 Memory std property.
 
 calls
 Calls property.
 

Detailed Description

Dictionary list holding the module statistics (like the C++ class ModuleStatistics)

Definition at line 13 of file entities.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  stats,
  categories 
)
Create a new module statistics entity.

Definition at line 19 of file entities.py.

19 def __init__(self, stats, categories):
20 """Create a new module statistics entity."""
21
22 self.name = stats.name
23
24 self.time_sum = self.get_dict(stats.time_sum, categories)
25
26 self.time_mean = self.get_dict(stats.time_mean, categories)
27
28 self.time_stddev = self.get_dict(stats.time_stddev, categories)
29
30 self.memory_sum = self.get_dict(stats.memory_sum, categories)
31
32 self.memory_mean = self.get_dict(stats.memory_mean, categories)
33
34 self.memory_stddev = self.get_dict(stats.memory_stddev, categories)
35
36 self.calls = self.get_dict(stats.calls, categories)
37

Member Function Documentation

◆ __getitem__()

def __getitem__ (   self,
  item 
)
Convenience function for the display.

Definition at line 46 of file entities.py.

46 def __getitem__(self, item):
47 """Convenience function for the display."""
48 if item == "name":
49 return self.name
50 elif item == "calls":
51 return self.calls["EVENT"]
52 elif item == "mem":
53 return self.memory_mean["EVENT"] * 1E-3
54 elif item == "time":
55 return np.round(self.time_sum["EVENT"] * 1E-9, 2)
56 elif item == "eventtime":
57 return np.round(self.time_mean["EVENT"] * 1E-6, 2), "±", np.round(self.time_stddev["EVENT"] * 1E-6, 2)
58
59

◆ get_dict()

def get_dict (   function,
  categories 
)
static
Call the function on each information in the categories and return a dict
name -> function(value)

Definition at line 39 of file entities.py.

39 def get_dict(function, categories):
40 """
41 Call the function on each information in the categories and return a dict
42 name -> function(value)
43 """
44 return {name: function(category) for name, category in categories}
45

Member Data Documentation

◆ calls

calls

Calls property.

Definition at line 36 of file entities.py.

◆ memory_mean

memory_mean

Memory mean property.

Definition at line 32 of file entities.py.

◆ memory_stddev

memory_stddev

Memory std property.

Definition at line 34 of file entities.py.

◆ memory_sum

memory_sum

Memory sum property.

Definition at line 30 of file entities.py.

◆ name

name

Name property.

Definition at line 22 of file entities.py.

◆ time_mean

time_mean

Time mean property.

Definition at line 26 of file entities.py.

◆ time_stddev

time_stddev

Time std property.

Definition at line 28 of file entities.py.

◆ time_sum

time_sum

Time sum property.

Definition at line 24 of file entities.py.


The documentation for this class was generated from the following file: