diff --git a/qcengine/compute.py b/qcengine/compute.py index aa93d115f..5a4588186 100644 --- a/qcengine/compute.py +++ b/qcengine/compute.py @@ -4,9 +4,7 @@ import copy import time -import traceback -from . import config from . import util # Single computes @@ -46,6 +44,7 @@ def compute(input_data, program, raise_error=False, capture_output=True): elif program == "rdkit": output_data = rdkit_compute.run_rdkit(input_data) else: + output_data = input_data output_data["success"] = False output_data["error_message"] = "QCEngine Call Error:\nProgram {} not understood".format(program) @@ -75,12 +74,11 @@ def compute_procedure(input_data, procedure, raise_error=False, capture_output=T input_data = copy.deepcopy(input_data) # Run the procedure - comp_time = time.time() with util.compute_wrapper(capture_output=capture_output) as metadata: - output_data = {} if procedure == "geometric": output_data = util.get_module_function("geometric", "run_json.geometric_run_json")(input_data) else: + output_data = input_data output_data["success"] = False output_data["error_message"] = "QCEngine Call Error:\nProcedure {} not understood".format(program) diff --git a/qcengine/tests/test_compute.py b/qcengine/tests/test_compute.py index 14f2f8261..087d1ec43 100644 --- a/qcengine/tests/test_compute.py +++ b/qcengine/tests/test_compute.py @@ -11,6 +11,12 @@ _base_json = {"schema_name": "qc_schema_input", "schema_version": 1} +def test_missing_key(): + ret = dc.compute({"hello": "hi"}, "bleh") + assert ret["success"] is False + assert "hello" in ret + + @addons.using_psi4 def test_psi4_task(): json_data = copy.deepcopy(_base_json)