From 1062bcf4f79c3714c28c41ab3ced019de229a1bf Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" Date: Tue, 27 Jan 2026 15:35:35 +0000 Subject: [PATCH] Pass through None dataset in spglib dot access wrapper get_dot_access_dataset is a wrapper designed to convert old-style (dictionary access) spglib results to new-style (class attribute access) objects. Currently it does not consider the case that it is passed "None", which is the error signal for spglib<2.7. This means that "if dataset is None" code block in seekpath.hpkot.__init__ is probably unreachable. To have this work as expected, allow None results to pass through the wrapper unchanged. --- seekpath/hpkot/tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/seekpath/hpkot/tools.py b/seekpath/hpkot/tools.py index 41df745..26e86be 100644 --- a/seekpath/hpkot/tools.py +++ b/seekpath/hpkot/tools.py @@ -258,6 +258,9 @@ def get_dot_access_dataset(dataset): To emulate it for older versions, this function is used. """ + if dataset is None: + return None + spg_version = Version(version('spglib')) if spg_version < Version('2.5.0'):