Pass through None dataset in spglib dot access wrapper #118
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have been trying to update the requirements of Euphonic to a recent seekpath and found that some combinations of seekpath and spglib were giving different error messages than expected when the symmetry cannot be detected. Specifically the behaviour is encountered when using seekpath 2.2 with older versions of spglib.
get_dot_access_datasetis 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 so if the wrappedspglibcall returns None it can raise something likeI think this means the "if dataset is None" code block in
seekpath.hpkot.__init__has become unreachable. To have this work as expected, this PR allowsNoneresults to pass through the wrapper unchanged.Here is a
uvscript (i.e. Python with dependencies declared in header) that reproduces the behaviour. You can get different results by changing the seekpath and spglib versions!