output_data = input_data.copy() // Initial in case of error handling
try:
output_data = get_program(program).compute(input_data, config)
except KeyError as e:
output_data = FailedOperation(
input_data=output_data.dict(),
success=False,
After Change
// Build the model and validate
input_data = model_wrapper(input_data, ResultInput)
error = _process_failure_and_return(input_data, return_dict, raise_error)
if error:
return error
// Grab the executor and build the input model
executor = get_program(program)
// Build out local options
if local_options is None:
local_options = {}
input_engine_options = input_data.extras.pop("_qcengine_local_config", {})
local_options = {**local_options, **input_engine_options}
config = get_config(local_options=local_options)
// Run the program
with compute_wrapper(capture_output=False) as metadata:
output_data = input_data.copy() // lgtm [py/multiple-definition]
output_data = executor.compute(input_data, config)
return handle_output_metadata(output_data, metadata, raise_error=raise_error, return_dict=return_dict)