Skip to content

Commit

Permalink
Fix get_func bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Jan 26, 2024
1 parent 8ad68b9 commit 8a92221
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions cylc/flow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,7 @@ def generate_triggers(self, lexpression, left_nodes, right, seq,
)

if self.xtrigger_mgr is None:
# Validation only.
XtriggerManager.validate_xtrigger(label, xtrig, self.fdir)
else:
self.xtrigger_mgr.add_trig(label, xtrig, self.fdir)
Expand Down
8 changes: 4 additions & 4 deletions cylc/flow/subprocpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ def get_func(mod_name, func_name, src_dir):
AttributeError, if the function is not found in the module
"""
if func_name in _XTRIG_FUNCS:
if (mod_name, func_name) in _XTRIG_FUNCS:
# Found and cached already.
return _XTRIG_FUNCS[func_name]
return _XTRIG_FUNCS[(mod_name, func_name)]

# 1. look in <src-dir>/lib/python.
sys.path.insert(0, os.path.join(src_dir, 'lib', 'python'))
Expand All @@ -94,8 +94,8 @@ def get_func(mod_name, func_name, src_dir):

# Module found and imported, return the named function.

_XTRIG_FUNCS[func_name] = getattr(mod_by_name, func_name)
return _XTRIG_FUNCS[func_name]
_XTRIG_FUNCS[(mod_name, func_name)] = getattr(mod_by_name, func_name)
return _XTRIG_FUNCS[(mod_name, func_name)]


def run_function(func_name, json_args, json_kwargs, src_dir):
Expand Down
3 changes: 1 addition & 2 deletions cylc/flow/xtriggers/wall_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ def validate_config(f_args, f_kwargs, f_signature):
wall_clock(PT1H)
wall_clock(offset=PT1H)
And offset must be a valid ISO 8601 interval.
The offset must be a valid ISO 8601 interval.
If f_args used, convert to f_kwargs for clarity.
"""

n_args = len(f_args)
n_kwargs = len(f_kwargs)

Expand Down

0 comments on commit 8a92221

Please sign in to comment.