Skip to content

Commit

Permalink
fix: Legacy funcx functions not being registered or tracked
Browse files Browse the repository at this point in the history
  • Loading branch information
NickolausDS committed Jun 29, 2023
1 parent 08be06b commit 1e823a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion gladier/client.py
Expand Up @@ -359,7 +359,9 @@ def get_compute_function_ids(self):
compute_ids = dict()
for tool in self.tools:
log.debug(f'Checking functions for {tool}')
compute_funcs = getattr(tool, 'compute_functions', [])
compute_funcs = (
getattr(tool, 'compute_functions', []) + getattr(tool, 'funcx_functions', [])
)
if not compute_funcs:
log.warning(f'Tool {tool} did not define any compute functions!')
if not compute_funcs and not isinstance(compute_funcs, Iterable):
Expand Down
5 changes: 4 additions & 1 deletion gladier/utils/flow_modifiers.py
Expand Up @@ -30,7 +30,10 @@ class FlowModifiers:
def __init__(self, tools, modifiers, cls=None):
self.cls = cls
self.tools = tools
self.functions = [func for tool in tools for func in tool.compute_functions]
self.functions = (
[func for tool in tools for func in tool.compute_functions] +
[func for tool in tools for func in getattr(tool, 'funcx_functions', [])]
)
self.function_names = [f.__name__ for f in self.functions]
self.state_names = [get_compute_flow_state_name(f) for f in self.functions]
self.modifiers = modifiers
Expand Down

0 comments on commit 1e823a7

Please sign in to comment.