Skip to content

Commit

Permalink
extra inputs and output for psi4
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Oct 31, 2023
1 parent 7cad296 commit 9e7178b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions qcengine/programs/psi4.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,18 @@ def compute(self, input_model: "AtomicInput", config: "TaskConfig") -> "AtomicRe
]
if config.scratch_messy:
run_cmd.append("--messy")
input_files = {"data.msgpack": input_model.serialize("msgpack-ext")}
extra_infiles = input_model.extras.get("extra_infiles", {})
extra_outfiles = input_model.extras.get("extra_outfiles", [])
input_files = {"data.msgpack": input_model.serialize("msgpack-ext"), **extra_infiles}
output_files = ["data.msgpack", *extra_outfiles]
success, output = execute(
run_cmd, input_files, ["data.msgpack"], as_binary=["data.msgpack"], scratch_directory=tmpdir
run_cmd, input_files, output_files, as_binary=["data.msgpack"], scratch_directory=tmpdir
)
if success:
output_data = deserialize(output["outfiles"]["data.msgpack"], "msgpack-ext")
for k, v in output["outfiles"].items():
if k != "data.msgpack" and v is not None:
output_data["native_files"][k] = v
else:
output_data = input_model.dict()

Expand Down
2 changes: 1 addition & 1 deletion qcengine/programs/tests/test_canonical_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,6 @@ def test_protocol_native(program, model, keywords, native):
assert re.search(
input_ref[program], ret.native_files["input"]
), f"Input file pattern not found: {input_ref[program]}"
if native == "all" and program != "psi4": # allow psi4 once native_files PR merged
if native == "all":
fl, snip = all_ref[program]
assert re.search(snip, ret.native_files[fl]), f"Ancillary file pattern not found in {fl}: {snip}"

0 comments on commit 9e7178b

Please sign in to comment.