Skip to content

Commit

Permalink
fix docstrings overload incompatability.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPugh committed Mar 5, 2023
1 parent d5de3b2 commit f3ead8c
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions belay/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,9 +719,7 @@ def setup(
def setup(
f: Optional[Callable[P, R]] = None, autoinit=False, **kwargs
) -> Union[Callable[[Callable[P, R]], Callable[P, R]], Callable[P, R]]:
"""setup(f, *, minify=True, register=True, record=True)
Decorator that executes function's body in a global-context on-device when called.
"""Execute decorated function's body in a global-context on-device when called.
Function arguments are also set in the global context.
Expand Down Expand Up @@ -773,10 +771,7 @@ def teardown(**kwargs) -> Callable[[Callable[P, R]], Callable[P, R]]:
def teardown(
f: Optional[Callable[P, R]] = None, **kwargs
) -> Union[Callable[[Callable[P, R]], Callable[P, R]], Callable[P, R]]:
"""teardown(f, *, minify=True, register=True, record=True)
Decorator that executes function's body in a global-context on-device
when ``device.close()`` is called.
"""Executes decorated function's body in a global-context on-device when ``device.close()`` is called.
Function arguments are also set in the global context.
Expand Down Expand Up @@ -821,9 +816,10 @@ def task(**kwargs) -> Callable[[Callable[P, R]], Callable[P, R]]:
def task(
f: Optional[Callable[P, R]] = None, **kwargs
) -> Union[Callable[[Callable[P, R]], Callable[P, R]], Callable[P, R]]:
"""task(f, *, minify=True, register=True, record=False)
"""Execute decorated function on-device.
Decorator that send code to device that executes when decorated function is called on-host.
Sends source code to device at decoration time.
Execution sends involves much smaller overhead.
Can either be used as a staticmethod ``@Device.task`` for marking methods in a subclass of ``Device``, or as a standard method ``@device.task`` for marking functions to a specific ``Device`` instance.
Expand Down Expand Up @@ -863,9 +859,7 @@ def thread(**kwargs) -> Callable[[Callable[P, R]], Callable[P, R]]:
def thread(
f: Optional[Callable[P, R]] = None, **kwargs
) -> Union[Callable[[Callable[P, R]], Callable[P, R]], Callable[P, R]]:
"""thread(f, *, minify=True, register=True, record=True)
Decorator that send code to device that spawns a thread when executed.
"""Spawn on-device thread that executes decorated function.
Can either be used as a staticmethod ``@Device.thread`` for marking methods in a subclass of ``Device``, or as a standard method ``@device.thread`` for marking functions to a specific ``Device`` instance.
Expand Down

0 comments on commit f3ead8c

Please sign in to comment.