ATLAS Offline Software
Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
python.sugar.runlumi.TimestampType Class Reference
Inheritance diagram for python.sugar.runlumi.TimestampType:
Collaboration diagram for python.sugar.runlumi.TimestampType:

Public Member Functions

def __repr__ (self)
 
def __str__ (self)
 
def date (self)
 
def from_date (cls, date)
 
def from_string (cls, date_string)
 

Static Public Attributes

bool is_time = True
 

Static Private Attributes

tuple __slots__ = ()
 

Detailed Description

Definition at line 91 of file runlumi.py.

Member Function Documentation

◆ __repr__()

def python.sugar.runlumi.TimestampType.__repr__ (   self)

Definition at line 95 of file runlumi.py.

95  def __repr__(self):
96  return str(self.date) + " UTC"
97 

◆ __str__()

def python.sugar.runlumi.TimestampType.__str__ (   self)

Definition at line 98 of file runlumi.py.

98  def __str__(self):
99  return self.__repr__()
100 

◆ date()

def python.sugar.runlumi.TimestampType.date (   self)

Definition at line 102 of file runlumi.py.

102  def date(self):
103  if self == IOV_MAX:
104  return "([MAX]:[MAX])"
105  try:
106  return date_from_timestamp(self/1e9)
107  except ValueError:
108  return "[InvalidDate]"
109 

◆ from_date()

def python.sugar.runlumi.TimestampType.from_date (   cls,
  date 
)

Definition at line 111 of file runlumi.py.

111  def from_date(cls, date):
112  return cls((timegm(date.utctimetuple()) * 1000000000)
113  + 1000*date.microsecond)
114 

◆ from_string()

def python.sugar.runlumi.TimestampType.from_string (   cls,
  date_string 
)
Create a TimestampType IOVKey from a %d/%m/%Y string or %H:%M:%S

Definition at line 116 of file runlumi.py.

116  def from_string(cls, date_string):
117  """
118  Create a TimestampType IOVKey from a %d/%m/%Y string or %H:%M:%S
119  """
120  try:
121  d = datetime.strptime(date_string, "%d/%m/%Y")
122  except ValueError:
123  try:
124  d = datetime.strptime(date_string, "%d/%m/%Y %H:%M:%S")
125  except ValueError:
126  log.exception("Invalid")
127  raise
128 
129  return cls.from_date(d)

Member Data Documentation

◆ __slots__

tuple python.sugar.runlumi.TimestampType.__slots__ = ()
staticprivate

Definition at line 92 of file runlumi.py.

◆ is_time

bool python.sugar.runlumi.TimestampType.is_time = True
static

Definition at line 93 of file runlumi.py.


The documentation for this class was generated from the following file:
CaloClusterListBadChannel.cls
cls
Definition: CaloClusterListBadChannel.py:8
python.sugar.runlumi.date_from_timestamp
date_from_timestamp
Definition: runlumi.py:10
fillHVMap_fromASCII.date
string date
Definition: fillHVMap_fromASCII.py:8
str
Definition: BTagTrackIpAccessor.cxx:11