Orca MM Runner - #224
Conversation
timmyte
left a comment
There was a problem hiding this comment.
@MattBurn
Thanks a lot for the PR. Thanks a very nice addition and improvement for OPI. Also thanks to directly include proper tests.
I would appreciate if you could overall add more comments and documentation to the code. Most patterns are very repetitive, so they would only a single documentation somewhere prominently on module level.
Co-authored-by: Tim Tetenberg <123412573+timmyte@users.noreply.github.com>
Co-authored-by: Tim Tetenberg <123412573+timmyte@users.noreply.github.com>
Co-authored-by: Tim Tetenberg <123412573+timmyte@users.noreply.github.com>
`_run_orca_mm_and_expect` for running orca mm and checking expected outputs
FileNotFoundError
…`suffix` from `Path.suffix`
|
With the newly merged #235, I rebased this branch to allow the use of the new I have resolved most comments from the previous review, if you are not happy with any of the resolutions feel free to let me know. I have left some comments unresolved:
Would I be able to request a new review to make sure I have properly resolved the comments from the previous review and to check through the integration with the new |
| runner, _ = orca_mm_runner_factory(returncode=1, stderr="orca_mm failed") | ||
|
|
||
| with pytest.raises(OrcaMmError, match="orca_mm failed"): | ||
| runner.run_orca_mm("convff", ["-amber", "test.prm"]) |
There was a problem hiding this comment.
Im wondering if this test should include a more specific field for stderr. Since the error is reported as:
f"orca_mm failed with the following error:\n{error.strip()}"
the test would pass regardless of what string value is set for stderr. A more specific error text would make for a better test
| FileNotFoundError | ||
| If one or more paths do not point to existing files. | ||
| """ | ||
| missing_files = [path for path in files if not path.is_file()] |
There was a problem hiding this comment.
It would be good to resolve the file path here before checking whether the file exists. That could be done either here or before this method is called , I would leave that decision up to you .
Closes Issues
Closes #185
Description
Adds
OrcaMmRunnerinopi.execution.orca_mmfor executing supportedorca_mmcommands throughopi.The runner provides typed helpers for:
orca_mm -convfforca_mm -splitfforca_mm -mergefforca_mm -repeatfforca_mm -splitpdborca_mm -mergepdborca_mm -makefforca_mm -getHDistEach command-specific method validates its input files and arguments, assembles the appropriate command line, executes
orca_mm, and verifies that the expected output files were generated.The lower-level
run_orca_mm()method builds on the updatedBaseRunner.run()API introduced in #238. It supportsstdoutandstderrstream targets, returns aRunResult, and raisesOrcaMmErrorby default whenorca_mmexits with a nonzero return code. STDERR is captured when required so that it can be included in the error message while still being forwarded to any caller-provided stream targets.Release Notes
Added
OrcaMmRunnerwith typed helpers for supportedorca_mmcommands. (Orca MM Runner #224)OrcaBinary.ORCA_MM. (Orca MM Runner #224)OpiError,OpiExecutionError, andOrcaMmError. (Orca MM Runner #224)orca_mmcommand helpers. (Orca MM Runner #224)