-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
I would like to provide documentation (with doctests) for a FunctionTask, like:
@task
@annotate({"return": {"sum": int}})
def add(x: int, y: int):
"""Add x to y.
Examples
----------
>>> task = add(x=1, y=2)
>>> result = task()
>>> result.output.sum
3
"""
return a + bSimilar to what we have been doing with interfaces implemented with ShellCommandTask.
This does not work however, since the docstring of the wrapped function is not propagated to the FunctionTask class. So far, I have implemented one wrapped function per Python module and used the module's docstring for this purpose.
I wonder whether we could propagate this docstring so that each FunctionTask can have its own documentation.
Unless there is already a feature to achieve this that I totally missed.
effigies
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request