CENSO 3.0.8

Webpage

https://github.com/grimme-lab/CENSO
https://xtb-docs.readthedocs.io/en/latest/CENSO_docs/censo.html

Version

3.0.8

Installation Environment

  • Python 3.14.2 (pyenv 2.6.17)
  • anmr (enso 2.0.2)
  • other dependent packages

Brief Installation Procedure

$ module purge
$ module load pyenv/2.6.17
$ export PYENV_ROOT=/apl/pyenv/repos/2.6.17
$ pyenv virtualenv 3.14.2 3.14.2-censo-3.0.8
$ pyenv activate 3.14.2-censo-3.0.8
(3.14.2-censo-3.0.8) $ eval "$(pyenv init -)"
(3.14.2-censo-3.0.8) $ pip install censo pytest matplotlib pandas

additional patch

Following patch file is applied to config/paths.py.

--- paths.py.org    2026-06-26 10:20:14.000000000 +0900
+++ paths.py    2026-06-26 10:57:43.000000000 +0900
@@ -10,7 +10,7 @@
     model_validator,
 )
 from pathlib import Path
-import mmap
+import subprocess
 
 from ..params import PLENGTH
 from ..utilities import h2
@@ -157,31 +157,27 @@
         """
         if self.orca:
             # Try parsing version from binary directly
-            with open(self.orca, "rb") as f:
-                version_pattern = rb"Program Version (\d+\.\d+\.\d+)"
-                version_bytes: bytes | None = None
-
-                try:
-                    with mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as mm:
-                        match_bytes = re.search(version_pattern, mm)
-                        if match_bytes:
-                            # Copy the matched bytes out of the mmap buffer before
-                            # it is closed; accessing group(1) after context exit
-                            # raises TypeError on some platforms.
-                            version_bytes = bytes(match_bytes.group(1))
-                except (OSError, ValueError):
-                    # Some files (or mocked files in tests) cannot be memory-mapped,
-                    # e.g. empty files. Fall back to reading bytes directly.
-                    f.seek(0)
-                    match_bytes = re.search(version_pattern, f.read())
-                    if match_bytes:
-                        version_bytes = bytes(match_bytes.group(1))
-
-                if not version_bytes:
-                    raise ValueError(
-                        f"Could not determine ORCA version. Please check {self.orca}"
-                    )
+            version_pattern = r"Program Version (\d+\.\d+\.\d+)"
+            version: string | None = None
+            try:
+                # NOTE: /dev/null is not a valid argument
+                result = subprocess.run(
+                    [ self.orca, "/dev/null" ],
+                    capture_output=True, text=True, check=False
+                )
+                match = re.search( version_pattern, result.stdout )
+                if match:
+                  version = match.group(1)
+            except FileNotFoundError:
+                print(f"File not found: {self.orca}")
+            except Exception as e:
+                print(e)
+
+            if not version:
+                raise ValueError(
+                    f"Could not determine ORCA version. Please check {self.orca}"
+                )
 
-                self._orcaversion = version_bytes.decode("utf-8")
+            self._orcaversion = version
 
         return self

Notes

  • Except for the additional patch, the procedure is the same as that for CENSO 3.0.5.