Get pseudos without requiring recommended cutoffs - #98
Open
elinscott wants to merge 2 commits into
Open
Conversation
`Wannier90BaseWorkChain.get_builder_from_protocol` refused any pseudopotential family that recommends no cutoffs: a cutoffs family with no stringency set was rejected with "no default stringency has been defined", and a plain family, which `aiida-pseudo install family` produces, with "is not installed". The builder discarded the cutoffs it had just demanded. - Add `get_pseudos`, which resolves a family of any `aiida-pseudo` class by label and returns its pseudos for a structure. - Take the Wannier90 protocol builder's pseudos from it, in place of `get_pseudo_and_cutoff`. - Keep `get_pseudo_and_cutoff` searching only the families that can recommend cutoffs, so external callers see no change. - Cover both refused family shapes at the builder, against a family with cutoffs as control. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Summary
This PR enables custom pseudo families to be used when building workflows from protocols.
Problem
Wannier90BaseWorkChain.get_builder_from_protocolrefuses any pseudopotential family that recommends no cutoffs, even though the builder never uses cutoffs. THis means that one can't use...CutoffsPseudoPotentialFamilywhose stringencies were never set, refused withfailed to obtain recommended cutoffs for pseudo family ...: no default stringency has been defined;PseudoPotentialFamily(the shapeaiida-pseudo install familyproduces) refused withrequired pseudo family ... is not installedbecause that class is not among those the lookup searches.Cause
Both come from one line
which asks for cutoffs and then discards them; the pseudos are wanted only to count bands and projections. That is the only call to
get_pseudo_and_cutoffin the package.The practical cost is that pseudopotentials outside
aiida-pseudo's catalogue cannot be Wannierized through the protocols at all.Changes
get_pseudos(pseudo_family, structure), which resolves a family by label and returns its pseudos per kind. It accepts anyaiida-pseudofamily class and asks for no cutoffs.get_pseudos. Which families are accepted changes; what is built from them does not.get_pseudo_and_cutoffas it was for external callers: same signature and return, and it still searches only SSSP, PseudoDojo and cutoffs families, because those are the ones that can recommend cutoffs.With this, a user's own pseudos reach the Wannier90 builder:
$ aiida-pseudo install family ./my_pseudos.tar.gz MyPseudos/localThe pw.x sub-workchains still need
ecutwfcandecutrhosupplied throughoverrides, sincePwBaseWorkChainreally does use the cutoffs. A cutoff-less family with no such overrides now fails there, naming the cutoffs, instead of failing earlier in the Wannier90 builder that had no use for them.Testing
Wannier90BaseWorkChain.get_builder_from_protocolproduces wannier90 parameters equal to those built from a family that does recommend cutoffs. Equality is the point: it discriminates a builder that merely stops raising from one that builds the same inputs. Both fail onmain— one with the stringency error, one with "is not installed" — while the other nineteen tests in that file pass unchanged.get_pseudosover the two refused shapes, an SSSP family as control, and an unknown label.get_pseudo_and_cutoff's unchanged contract: it still returns SSSP's cutoffs, and it still refuses a family that cannot supply them.Fixtures for the two family shapes are added to
tests/conftest.py, next to the existingpseudosfixture and built from the same synthetic UPF streams, so the pseudos differ from the SSSP family's only in which group they belong to.Related
#95 will fix the failing test suite
#94 removes the other wall a custom pseudo family meets:
get_pseudo_orbitalsresolves pseudopotentials by md5 against the bundled semicore tables, so anything outside the curated families fails there too. The two are independent — this one is the cutoff lookup, that one the orbital lookup — and a hand-built family needs both to get through the protocols.