scistag.remotestag.service_function.RemoteFunction

class RemoteFunction(service, function_name)[source]

Bases: object

Base class for a remote callable function

Initializer :type service: RemoteService :param service: The service to which this function shall be added :type function_name: str :param function_name:

Methods

get_full_identifier

Returns the function's full identifier :rtype: str :return: The identifier including the domain

run

Overwrite this with the code you want to execute :type parameters: dict :param parameters: The input parameters :rtype: dict :return: The result

unwrap

Returns a dictionary wrapping a single result value :type input_dict: dict :param input_dict: A dictionary :rtype: str | int | bool | float | bytes | np.ndarray | dict :return: The single value in the dictionary if wrapped, otherwise the dictionary

wrap

Returns a dictionary wrapping a single result value :type result_value: str | int | bool | float | bytes | np.ndarray :param result_value: The simple result value :return: The dictionary to be stored in the task's result

Attributes

INPUT_VALUE

The input value

RESULT_VALUE

Result value identifier

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

get_full_identifier()[source]

Returns the function’s full identifier :rtype: str :return: The identifier including the domain

abstract run(parameters)[source]

Overwrite this with the code you want to execute :type parameters: dict :param parameters: The input parameters :rtype: dict :return: The result

unwrap(input_dict)[source]

Returns a dictionary wrapping a single result value :type input_dict: dict :param input_dict: A dictionary :rtype: str | int | bool | float | bytes | np.ndarray | dict :return: The single value in the dictionary if wrapped, otherwise the dictionary

wrap(result_value)[source]

Returns a dictionary wrapping a single result value :type result_value: str | int | bool | float | bytes | np.ndarray :param result_value: The simple result value :return: The dictionary to be stored in the task’s result

INPUT_VALUE = '_value'

The input value

RESULT_VALUE = '_resultValue'

Result value identifier