Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Add missing pydantic fields for calculation timings (#211)
- Added `scalmp2c` to `BlockMethod` (#212)
- Add SCF (spin-)density matrix to `Output` (#204)
- Add version check attribute to Calculator, which is parsed to get_output (#225)

### Changed
- Refactored methods from Runner into BaseRunner (#193)
Expand Down
18 changes: 16 additions & 2 deletions src/opi/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class Calculator:
Can only be disabled after initialization of a `Calculator` (not recommended!).
_input | input: Input
Contains all ORCA input parameters except for the primary structural information.
version_check: bool, default: True
Enable/disable ORCA binary version check as well as version check on the JSON output.
"""

def __init__(
Expand Down Expand Up @@ -94,7 +96,10 @@ def __init__(
# ----------------------------
# > BINARY VERSION CHECK
# ----------------------------
if version_check:

self.version_check: bool = version_check

if self.version_check:
# > Raises RuntimeError if version is not compatible or cannot be determined.
self.check_version()

Expand Down Expand Up @@ -304,14 +309,23 @@ def create_jsons(self, *, force: bool = False) -> None:
runner = self._create_runner()
runner.create_jsons(self.basename, force=force)

def get_output(self) -> "Output":
def get_output(self, *, version_check: bool | None = None) -> "Output":
"""
Get an instance of `Output` setup for the current job.
Comment thread
crjacinto marked this conversation as resolved.
Can be called before execution of job.

Parameters
----------
version_check : bool | None, default=None
Whether to perform a version check on the output.
If `None`, the value of `self.version_check` is used.
"""
vc = self.version_check if version_check is None else version_check

return Output(
basename=self.basename,
working_dir=self.working_dir,
version_check=vc,
)

def check_version(self) -> None:
Expand Down
Loading