Repository navigation
Handle embedded PySCF basis sets in cclib2pyscf metadata - #1927
Open
barlowa124 wants to merge 1 commit into
Open
barlowa124 wants to merge 1 commit into
barlowa124 wants to merge 1 commit into
Conversation
makecclib crashed with 'unhashable type: list' when a PySCF molecule was built with a basis dict whose values are parsed basis data rather than basis names, because the metadata builder ran set() over the dict values. Non-string values are now labelled 'custom', so embedded basis sets parse fine while named per-element bases are still joined and deduplicated as before.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1851.
cclib2pyscf.makecclibcrashed withTypeError: unhashable type: 'list'for any PySCF molecule built with an embedded basis set, i.e.gto.M(basis={...: gto.parse(...)}). In that casemol.basisis a dict whose values are parsed basis data (nested lists) rather than basis names, and the metadata builder calledset()on them.Non-string dict values are now labelled
custom, so embedded basis sets producebasis_set: "custom"while named per-element bases are still deduplicated and joined as before ({"H": "sto-3g", "C": "sto-3g"}->"sto-3g").On the issue's reproduction with a minimal
H2molecule and a parsed basis,makecclibnow completes and yields the expected metadata for embedded and named basis inputs. Addedtest_makecclib_custom_basistotest/bridge/testpyscf.py, andpytest test/bridge/testpyscf.pypasses all three tests.