| 263 | return name in self.summaries |
| 264 | |
| 265 | def add_child(self, name: str) -> "OutputCollection": |
| 266 | if not re.fullmatch("^[a-z][a-z0-9_]*$", name): |
| 267 | raise ValueError(f'Invalid child name "{name}"') |
| 268 | if name in self: |
| 269 | raise OutputConflictError(f"{name} already present") |
| 270 | child = new_output_collection() |
| 271 | self.summaries[name] = child.summaries |
| 272 | self.state_updates[name] = child.state_updates |
| 273 | self.module_outputs[name] = child.module_outputs |
| 274 | return child |
| 275 | |
| 276 | def update(self, collection: "OutputCollection"): |
| 277 | self.summaries.update(**collection.summaries) |