ATLAS Offline Software
Public Member Functions | Public Attributes | Private Member Functions | List of all members
python.AutoConfigFlags.DynamicallyLoadMetadata Class Reference
Collaboration diagram for python.AutoConfigFlags.DynamicallyLoadMetadata:

Public Member Functions

def __init__ (self, filename)
 
def get (self, key, default)
 
def __contains__ (self, key)
 
def __getitem__ (self, key)
 
def __repr__ (self)
 
def keys (self)
 

Public Attributes

 metadata
 
 filename
 
 metAccessLevel
 

Private Member Functions

def _loadMore (self)
 

Detailed Description

Definition at line 12 of file AutoConfigFlags.py.

Constructor & Destructor Documentation

◆ __init__()

def python.AutoConfigFlags.DynamicallyLoadMetadata.__init__ (   self,
  filename 
)

Definition at line 13 of file AutoConfigFlags.py.

13  def __init__(self, filename):
14  self.metadata = {}
15  self.filename = filename
16  self.metAccessLevel = 'lite'
17  thisFileMD = read_metadata(filename, None, 'lite')
18  self.metadata.update(thisFileMD[self.filename])
19  msg.debug("Loaded using 'lite' %s", str(self.metadata))
20 

Member Function Documentation

◆ __contains__()

def python.AutoConfigFlags.DynamicallyLoadMetadata.__contains__ (   self,
  key 
)

Definition at line 38 of file AutoConfigFlags.py.

38  def __contains__(self, key):
39  self.get(key, None)
40  return key in self.metadata
41 

◆ __getitem__()

def python.AutoConfigFlags.DynamicallyLoadMetadata.__getitem__ (   self,
  key 
)

Definition at line 42 of file AutoConfigFlags.py.

42  def __getitem__(self, key):
43  return self.get(key, None)
44 

◆ __repr__()

def python.AutoConfigFlags.DynamicallyLoadMetadata.__repr__ (   self)

Definition at line 45 of file AutoConfigFlags.py.

45  def __repr__(self):
46  return repr(self.metadata)
47 

◆ _loadMore()

def python.AutoConfigFlags.DynamicallyLoadMetadata._loadMore (   self)
private

Definition at line 21 of file AutoConfigFlags.py.

21  def _loadMore(self):
22  thisFileMD = read_metadata(self.filename, None, 'peeker')
23  self.metadata.update(thisFileMD[self.filename])
24 

◆ get()

def python.AutoConfigFlags.DynamicallyLoadMetadata.get (   self,
  key,
  default 
)

Definition at line 25 of file AutoConfigFlags.py.

25  def get(self, key, default):
26  if key in self.metadata:
27  return self.metadata[key]
28  if self.metAccessLevel != 'peeker' \
29  and key not in lite_primary_keys_to_keep \
30  and key not in lite_TagInfo_keys_to_keep:
31  msg.info("Looking into the file in 'peeker' mode as the configuration requires more details: %s ", key)
32  self.metAccessLevel = 'peeker'
33  self._loadMore()
34  if key in self.metadata:
35  return self.metadata[key]
36  return default
37 

◆ keys()

def python.AutoConfigFlags.DynamicallyLoadMetadata.keys (   self)

Definition at line 48 of file AutoConfigFlags.py.

48  def keys(self):
49  return self.metadata.keys()
50 

Member Data Documentation

◆ filename

python.AutoConfigFlags.DynamicallyLoadMetadata.filename

Definition at line 15 of file AutoConfigFlags.py.

◆ metAccessLevel

python.AutoConfigFlags.DynamicallyLoadMetadata.metAccessLevel

Definition at line 16 of file AutoConfigFlags.py.

◆ metadata

python.AutoConfigFlags.DynamicallyLoadMetadata.metadata

Definition at line 14 of file AutoConfigFlags.py.


The documentation for this class was generated from the following file:
python.MetaReader.read_metadata
def read_metadata(filenames, file_type=None, mode='lite', promote=None, meta_key_filter=None, unique_tag_info_values=True, ignoreNonExistingLocalFiles=False)
Definition: MetaReader.py:52
PyAthena::repr
std::string repr(PyObject *o)
returns the string representation of a python object equivalent of calling repr(o) in python
Definition: PyAthenaUtils.cxx:106
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
str
Definition: BTagTrackIpAccessor.cxx:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.Bindings.__getitem__
__getitem__
Definition: Control/AthenaPython/python/Bindings.py:779
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67
python.Bindings.__contains__
__contains__
Definition: Control/AthenaPython/python/Bindings.py:765