decorators

decorators#

Custom law task method decorators.

Functions:

view_output_plots(fn, opts, task, *args, ...)

Decorator to view output plots.

view_output_plots(fn, opts, task, *args, **kwargs)[source]#

Decorator to view output plots.

This decorator is used to view the output plots of a task. It checks if the task has a view command, collects all the paths of the output files, and then opens each file using the view command.

Parameters:
  • fn (Callable) – The function to be decorated.

  • opts (Any) – Options for the decorator.

  • task (Task) – The task instance.

  • args (Any) – Variable length argument list.

  • kwargs (Any) – Arbitrary keyword arguments.

Return type:

tuple[Callable, Callable, Callable]

Returns:

A tuple containing the before_call, call, and after_call functions.