scistag.remotestag.service_function.RemoteFunction¶
- class RemoteFunction(service, function_name)[source]¶
Bases:
objectBase 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
Returns the function's full identifier :rtype:
str:return: The identifier including the domainOverwrite this with the code you want to execute :type parameters:
dict:param parameters: The input parameters :rtype:dict:return: The resultReturns 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
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
The input 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