From b423ddf6355f1cee4fa7d741fbc85bfc1a738d4d Mon Sep 17 00:00:00 2001 From: crjacinto Date: Wed, 1 Apr 2026 10:54:52 +0200 Subject: [PATCH 1/6] Version check added as Calculator attribute --- src/opi/core.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/opi/core.py b/src/opi/core.py index 0a93e054..77c16af9 100644 --- a/src/opi/core.py +++ b/src/opi/core.py @@ -39,6 +39,9 @@ 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 + Activates version check when running an ORCA calculation. When running a complete series of input generation, calculation, + and output processing, it overrides the get_output version check attribute. """ def __init__( @@ -94,6 +97,9 @@ def __init__( # ---------------------------- # > BINARY VERSION CHECK # ---------------------------- + + self.version_check: bool = version_check + if version_check: # > Raises RuntimeError if version is not compatible or cannot be determined. self.check_version() @@ -304,14 +310,19 @@ 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. Can be called before execution of job. """ + 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: From 77251b220eaf5d87e58d4efd1470b92129237634 Mon Sep 17 00:00:00 2001 From: crjacinto Date: Wed, 1 Apr 2026 14:51:51 +0200 Subject: [PATCH 2/6] Run nox session --- src/opi/core.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/opi/core.py b/src/opi/core.py index 77c16af9..ca1f200e 100644 --- a/src/opi/core.py +++ b/src/opi/core.py @@ -40,7 +40,7 @@ class Calculator: _input | input: Input Contains all ORCA input parameters except for the primary structural information. version_check: bool, default: True - Activates version check when running an ORCA calculation. When running a complete series of input generation, calculation, + Activates version check when running an ORCA calculation. When running a complete series of input generation, calculation, and output processing, it overrides the get_output version check attribute. """ @@ -310,9 +310,7 @@ def create_jsons(self, *, force: bool = False) -> None: runner = self._create_runner() runner.create_jsons(self.basename, force=force) - def get_output(self, - *, - version_check: bool | None = None) -> "Output": + def get_output(self, *, version_check: bool | None = None) -> "Output": """ Get an instance of `Output` setup for the current job. Can be called before execution of job. From d3bcee7e4065f8947c6497421d8a9829657e0efe Mon Sep 17 00:00:00 2001 From: crjacinto Date: Wed, 1 Apr 2026 16:49:55 +0200 Subject: [PATCH 3/6] Minor changes and Documentation corrections --- src/opi/core.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/opi/core.py b/src/opi/core.py index ca1f200e..303da703 100644 --- a/src/opi/core.py +++ b/src/opi/core.py @@ -40,8 +40,7 @@ class Calculator: _input | input: Input Contains all ORCA input parameters except for the primary structural information. version_check: bool, default: True - Activates version check when running an ORCA calculation. When running a complete series of input generation, calculation, - and output processing, it overrides the get_output version check attribute. + Enable/disable ORCA binary version check as well as version check on the JSON output. """ def __init__( @@ -100,7 +99,7 @@ def __init__( self.version_check: bool = version_check - if version_check: + if self.version_check: # > Raises RuntimeError if version is not compatible or cannot be determined. self.check_version() @@ -314,6 +313,12 @@ def get_output(self, *, version_check: bool | None = None) -> "Output": """ Get an instance of `Output` setup for the current job. 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 From db1ee54cf024e9ebb0ee379fbc1934d766ba46bb Mon Sep 17 00:00:00 2001 From: crjacinto Date: Thu, 2 Apr 2026 16:13:41 +0200 Subject: [PATCH 4/6] Backticks correction --- src/opi/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opi/core.py b/src/opi/core.py index 303da703..f48d7b96 100644 --- a/src/opi/core.py +++ b/src/opi/core.py @@ -318,7 +318,7 @@ def get_output(self, *, version_check: bool | None = None) -> "Output": ---------- 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. + If `None`, the value of `self.version_check` is used. """ vc = self.version_check if version_check is None else version_check From 43bccef7471db5427075388de6f1f9991cc36f0f Mon Sep 17 00:00:00 2001 From: haneug <38649381+haneug@users.noreply.github.com> Date: Tue, 7 Apr 2026 08:58:05 +0200 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0f0fd3e..d66babf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) From 9c7d06570f0cb7455284627e99d958ea5e3cea31 Mon Sep 17 00:00:00 2001 From: haneug <38649381+haneug@users.noreply.github.com> Date: Tue, 7 Apr 2026 09:03:39 +0200 Subject: [PATCH 6/6] Empty commit to trigger ci