def resolve_tool_contract(tool_contract, input_files, root_output_dir, root_tmp_dir, max_nproc, tool_options): """ Convert a ToolContract into a Resolved Tool Contract. :param tool_contract: Tool Contract interface :param input_files: List of input files (must be consistent with the tool contract input file list (types are not enforced) :param max_nproc: Max number of processors :param tool_options: dict of overridden options :type input_files: list[String] :type max_nproc: int :type tool_contract: ToolContract :type tool_options: dict :rtype: ResolvedToolContract :return: A Resolved tool contract """ output_files, resolved_options, nproc, resources = _resolve_core( tool_contract, input_files, root_output_dir, max_nproc, tool_options) task = ResolvedToolContractTask(tool_contract.task.task_id, tool_contract.task.is_distributed, input_files, output_files, resolved_options, nproc, resources) return ResolvedToolContract(task, tool_contract.driver)
def _standard_resolved_tool_contract_from_d(d): """Load a 'Standard' CLI task type""" tool_contract_id, is_distributed, input_files, output_files, tool_options, nproc, resource_types = __core_resolved_tool_contract_task_from_d(d) task = ResolvedToolContractTask(tool_contract_id, is_distributed, input_files, output_files, tool_options, nproc, resource_types) return __to_rtc_from_d(d)(task)