vantage6.algorithm.tools.wrap.wrap_algorithm#

wrap_algorithm(log_traceback=True)#

Wrap an algorithm module to provide input and output handling for the vantage6 infrastructure.

Data is received in the form of files, whose location should be specified in the following environment variables:

  • INPUT_FILE: input arguments for the algorithm. This file should be encoded in JSON format.

  • OUTPUT_FILE: location where the results of the algorithm should be stored

  • TOKEN_FILE: access token for the vantage6 server REST api

  • USER_REQUESTED_DATABASE_LABELS: comma-separated list of database labels that the user requested

  • <DB_LABEL>_DATABASE_URI: uri of the each of the databases that the user requested, where <DB_LABEL> is the label of the database given in USER_REQUESTED_DATABASE_LABELS.

The wrapper expects the input file to be a json file. Any other file format will result in an error.

Parameters:
  • module (str) – Python module name of the algorithm to wrap.

  • log_traceback (bool) – Whether to print the full error message from algorithms or not, by default False. Algorithm developers should set this to False if the error messages may contain sensitive information. By default True.

Return type:

None