- class viktor.external.generic.GenericAnalysis(files=None, executable_key=None, output_filenames=None)¶
GenericAnalysis can be used to evaluate an executable on third-party infrastructure. The executable is expected to be blocking, i.e. if the executable is invoked from command prompt, it should wait until the executable is finished. For security purposes the executable that should be called has to be defined in the configuration file of the worker.
files = [ ('input1.txt', file1), ('input2.txt', file2) ] generic_analysis = GenericAnalysis(files=files, executable_key="someexecutable", output_filenames=["output.txt"]) generic_analysis.execute(timeout=60) output_file = generic_analysis.get_output_file("output.txt")
Exceptions which can be raised during calculation:
File]]]) – Files that are transferred to the working directory on the server. Each file is a tuple containing the content and the filename which is used to save on the infrastructure.
str) – The key of the executable that needs to be evaluated. This key should be present in the configuration file of the worker.
str]) – A list of filenames (including extension) that are to be transferred back to the SDK. This filename is relative to the working directory.
At least one of the attributes above should be included in the call.
ValueError – when no attribute is included in call.
- get_output_file(filename, *, as_file=False)¶
str) – The name of the file (including extension) that you want to get.
bool) – Return as BytesIO (default) or File
- Return type