Skip to content

Commit

Permalink
fix: focusing on named_components
Browse files Browse the repository at this point in the history
  • Loading branch information
moversekostas committed Nov 14, 2024
1 parent b3fc252 commit 6604134
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions moai/engine/callbacks/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def __init__(
):
super().__init__(list)
if model:
self.data.extend((c for c in model.children() if isinstance(c, Callback)))
for c in model.children():
for k, v in c.items():
if isinstance(v, Callback):
self.data.append(v)
# deprecated self.data.extend((c for c in model.children() if isinstance(c, Callback)))

if hasattr(model, "named_components"):
for component in model.named_components.values():
if isinstance(component, Callback):
self.data.append(component)
if hasattr(model, "named_monitors"):
# search within named monitors
# for callbacks
Expand Down

0 comments on commit 6604134

Please sign in to comment.