Belle II Software  release-05-02-19
TestingPayloadEntry Class Reference

Public Member Functions

def __init__ (self, line, basedir)
 
def normalize (self, name=None, root_version=61408)
 
def checksum (self)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __le__ (self, other)
 
def __lt__ (self, other)
 
def __hash__ (self)
 
def iov_tuple (self)
 
def iov_str (self)
 

Public Attributes

 revision
 revision stored in the file
 
 module
 module name
 
 filename
 filename
 
 firstRun
 experiment/run of the first run
 
 finalRun
 experiment/run of the final run
 
 payload
 payload id, to be filled later
 
 iov
 iov id, to be filled later
 

Private Attributes

 __checksum
 variable for checksum, calculated on first access
 
 __id
 object to uniquely identify this entry (payload + iov)
 

Detailed Description

Class to keep information about an entry in the testing payloads storage file

Definition at line 18 of file testing_payloads.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  line,
  basedir 
)
Create new entry from line in testing payloads storage file

Definition at line 21 of file testing_payloads.py.

21  def __init__(self, line, basedir):
22  """Create new entry from line in testing payloads storage file"""
23  try:
24  name, revision, iov = line.split()
25  except ValueError:
26  raise ValueError("line must be of the form 'dbstore/<payloadname> <revision> "
27  "<firstExp>,<firstRun>,<finalExp>,<finalRun>'")
28  try:
29 
30  self.revision = int(revision)
31  except ValueError:
32  raise ValueError("revision must be an integer")
33 
34  try:
35 
36  self.module = name.split("/")[1]
37  except IndexError:
38  raise ValueError("payload name must be of the form dbstore/<payloadname>")
39 
40  try:
41  iov = [int(e) for e in iov.split(",")]
42  except ValueError:
43  raise ValueError("experiment and run numbers must be integers")
44 
45  if len(iov) != 4:
46  raise ValueError("IoV needs to be four values (firstExp,firstRun,finalExp,finalRun)")
47 
48 
49  self.filename = os.path.join(basedir, f"dbstore_{self.module}_rev_{self.revision}.root")
50 
51  self.firstRun = {"exp": iov[0], "run": iov[1]}
52 
53  self.finalRun = {"exp": iov[2], "run": iov[3]}
54 
55  self.__checksum = None
56 
57  self.__id = (self.module,) + tuple(iov)
58 
59  self.payload = None
60 
61  self.iov = None
62 

Member Function Documentation

◆ __eq__()

def __eq__ (   self,
  other 
)
Compare to other entries, only consider package, module and iov for equality

Definition at line 79 of file testing_payloads.py.

◆ __hash__()

def __hash__ (   self)
Provide hash function to be able to create a set

Definition at line 91 of file testing_payloads.py.

◆ __le__()

def __le__ (   self,
  other 
)
Compare to other entries, only consider package, module and iov for equality

Definition at line 83 of file testing_payloads.py.

◆ __lt__()

def __lt__ (   self,
  other 
)
Compare to other entries, only consider package, module and iov for equality

Definition at line 87 of file testing_payloads.py.

◆ __repr__()

def __repr__ (   self)
Convert to useful string representation

Definition at line 75 of file testing_payloads.py.

◆ checksum()

def checksum (   self)
Return checksum, calculated on first access

Definition at line 69 of file testing_payloads.py.

◆ iov_str()

def iov_str (   self)
String representation of IoV

Definition at line 100 of file testing_payloads.py.

◆ iov_tuple()

def iov_tuple (   self)
Return a tuple with the valid exp,run range

Definition at line 96 of file testing_payloads.py.

◆ normalize()

def normalize (   self,
  name = None,
  root_version = 61408 
)
Normalize the root file to have the same checksum for the same content

Definition at line 63 of file testing_payloads.py.


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