Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/moverseai/moai
Browse files Browse the repository at this point in the history
  • Loading branch information
tzole1155 committed Dec 10, 2024
2 parents 6918a56 + b56dfa3 commit a4b69a1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions moai/engine/callbacks/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,16 @@ def __init__(
):
super().__init__(list)
if model:
self.data.extend((c for c in model.children() if isinstance(c, Callback)))
# check for monads in the model
for flow in model.named_flows.values():
for module in flow.values():
if isinstance(module, Callback):
self.data.append(module)
if hasattr(model, "named_flows"): # check for monads in the model
for flow in model.named_flows.values():
for module in flow.values():
if isinstance(module, Callback):
self.data.append(module)

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 a4b69a1

Please sign in to comment.