Skip to content

Commit e38501c

Browse files
committed
Condense all_ofs in metadata
1 parent 1626455 commit e38501c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

utilities/metadata_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,17 @@ class All_Of(Collection):
252252

253253
def __post_init__(self):
254254
super().__post_init__()
255+
self._condense_all_ofs()
255256
_check_for_multiple_one_ofs(self)
256257

258+
def _condense_all_ofs(self):
259+
"""All_of in All_of can be condensed into a single All_of."""
260+
if self.all_ofs():
261+
all_ofs = self.all_ofs(pop=True)
262+
for ao in all_ofs:
263+
ao._condense_all_ofs()
264+
self.specs.extend(ao.specs)
265+
257266

258267
@dataclass
259268
class Group(Collection):

0 commit comments

Comments
 (0)