Addition of "valences" property to ElementBase and Species for mixed-valence ions#4187
Closed
benrich37 wants to merge 4 commits intomaterialsproject:masterfrom
Closed
Addition of "valences" property to ElementBase and Species for mixed-valence ions#4187benrich37 wants to merge 4 commits intomaterialsproject:masterfrom
benrich37 wants to merge 4 commits intomaterialsproject:masterfrom
Conversation
…valence ions. Changing "valence" property to refer return only element of "valences" property (if len > 1, raise same "ambiguous valence" ValueError as before)
…valence ions. Changing "valence" property to refer return only element of "valences" property (if len > 1, raise same "ambiguous valence" ValueError as before)
…ed a valence orbital more clear, wrote in testing for valences
Closed
Contributor
Author
|
closing this until I make those fixes |
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
Note: This code change is no longer required for #4078 and the
valencesproperty does not return(idx, ne)for every valence subshell but only every partially filled valence subshell (unless all subshells are filled, which causes only the last subshell to be returned). I don't see a use for this criteria, so I will fix this to behave as intended. I am also okay with letting this PR be closed and abandoned since it is no longer needed for #4078.Major changes:
(
if len(valence) > 1: raise ValueError(f"{self} has ambiguous valence"))and return signature changed from
tuple[int | np.nan, int]tolist[tuple[int | np.nan, int]](return valenceinstead ofreturn valence[0])ElementBaseandSpecieswas re-written to raise the ambiguous valence ValueError iflen(self.valences) > 1, and otherwise returnself.valences[0]TODO
valencesto return all valence subshells while maintaining selectivity ofvalence