Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra inputs and output for psi4 #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
extra inputs and output for psi4
  • Loading branch information
loriab committed Oct 31, 2023
commit 9e7178b3d0cbf818a6adfdb9c7eab17fd963219a
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}"
Loading