Skip to content

Commit

Permalink
Include xtrigger function signatures in cylc config
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Apr 18, 2024
1 parent 40139b1 commit 9a6d455
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes.d/6071.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`cylc config` now shows xtrigger function signatures.
7 changes: 7 additions & 0 deletions cylc/flow/subprocctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,10 @@ def get_signature(self):
args = self.func_args + [
"%s=%s" % (i, self.func_kwargs[i]) for i in skeys]
return "%s(%s)" % (self.func_name, ", ".join([str(a) for a in args]))

def __str__(self) -> str:
"""
>>> str(SubFuncContext('label', 'my_func', [1, 2], {'a': 3}))
'my_func(1, 2, a=3):10.0'
"""
return f"{self.get_signature()}:{self.intvl}"

0 comments on commit 9a6d455

Please sign in to comment.