DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
rename_duplicate_dals.DalGroup Class Reference

Public Member Functions

 __init__ (self, List[tuple] pairs, Dict[Configuration, RelationshipCache] trees)
 
List[DalBasedals (self)
 
bool has_same_parents (self)
 
int __len__ (self)
 
ExtendedDal __getitem__ (self, int idx)
 
 __iter__ (self)
 

Public Attributes

 members = seen
 

Detailed Description

A deduplicated group of DAL objects that share the same repr (i.e. are duplicates).

Definition at line 129 of file rename_duplicate_dals.py.

Constructor & Destructor Documentation

◆ __init__()

rename_duplicate_dals.DalGroup.__init__ ( self,
List[tuple] pairs,
Dict[Configuration, RelationshipCache] trees )

Definition at line 132 of file rename_duplicate_dals.py.

132 def __init__(self, pairs: List[tuple], trees: Dict[Configuration, RelationshipCache]):
133 seen: List[ExtendedDal] = []
134 for dal, config in pairs:
135 ext = ExtendedDal(dal, config, trees[config])
136 if not any(ext == existing for existing in seen):
137 seen.append(ext)
138 self.members = seen
139

Member Function Documentation

◆ __getitem__()

ExtendedDal rename_duplicate_dals.DalGroup.__getitem__ ( self,
int idx )

Definition at line 151 of file rename_duplicate_dals.py.

151 def __getitem__(self, idx: int) -> ExtendedDal:
152 return self.members[idx]
153

◆ __iter__()

rename_duplicate_dals.DalGroup.__iter__ ( self)

Definition at line 154 of file rename_duplicate_dals.py.

154 def __iter__(self):
155 return iter(self.members)
156
157
158# ----- Tree-based sorting -----
159

◆ __len__()

int rename_duplicate_dals.DalGroup.__len__ ( self)

Definition at line 148 of file rename_duplicate_dals.py.

148 def __len__(self) -> int:
149 return len(self.members)
150

◆ dals()

List[DalBase] rename_duplicate_dals.DalGroup.dals ( self)

Definition at line 141 of file rename_duplicate_dals.py.

141 def dals(self) -> List[DalBase]:
142 return [m.dal for m in self.members]
143

◆ has_same_parents()

bool rename_duplicate_dals.DalGroup.has_same_parents ( self)

Definition at line 145 of file rename_duplicate_dals.py.

145 def has_same_parents(self) -> bool:
146 return any(a.has_same_parents(b) for a, b in combinations(self.members, 2))
147

Member Data Documentation

◆ members

rename_duplicate_dals.DalGroup.members = seen

Definition at line 138 of file rename_duplicate_dals.py.


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