Skip to content

Custom function extension #771

Description

@linshokaku

Implement a helper Extension that makes it easy to create a custom Extension that takes no manager as an argument and executes a pure custom function controlled by a trigger.

Custom functions that do not take manager as an argument can perform two main operations

  • Side-effect operations on arguments
  • report on execution ppe.reporting.report()

As for side-effect operations, it is not possible to control them as a function of PPE due to the python specification, so no specific action is taken.

The report function would be more convenient if it could report on values returned by dict, following the PPE's handler module.

Therefore, I would implement it with the following interface

class UserFunctionExtension(Extension):
    priority = PRIORITY_WRITER
    def __init__(self, fn: Callable[..., Dict[str, Scalar]], args: Sequenc[Any], kwargs: Mapping[Any], report_prefix: str = None, priority: int = PRIORITY_WRITER) -> None:
        ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions