Nexus: Refactor periodic_table.py#5832
Open
brockdyer03 wants to merge 8 commits intoQMCPACK:developfrom
Open
Conversation
prckent
reviewed
Feb 24, 2026
Contributor
prckent
left a comment
There was a problem hiding this comment.
Wondering what is the sourcing for all the magic numbers in the periodic_table.py file?
Ideally it comes from NIST, we can add a citation, and it was automated so that the prospect of introduced errors is minimal..
Contributor
|
Note: this PR depends on Python 3.10 and so issue #5816 must be resolved first. |
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.
Proposed changes
This PR updates
nexus/periodic_table.pyin several ways:is_element()function.ptable.elements[1].atomic_weightyou can doElements(1).atomic_weightorElements("H").atomic_weightamong other things)Note on updated atomic weights
One "problem" that may arise here is that the updated atomic weights are slightly different than the historic weights. I have updated the relevant tests, but I will note that calculations that use Nexus's atomic weights may be slightly different.
What type(s) of changes does this code introduce?
Does this introduce a breaking change?
What systems has this change been tested on?
Laptop, Fedora 43, Python 3.14.2, Numpy 2.4.2
Checklist