-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multiplicicites table for verification of compilation scripts #36
Conversation
…her than `get_element_data` function.
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this PR still necessary? If so, I think it's a good start.
In data/utils.py, I would just instantiate a single MultsTable instance, since I think it's a singleton pattern; then export the instance.
__all__ = [
"multiplicities",
...
]
class _MultsTable:
...
multiplicities = _MultsTable()
Better yet, if this can just be a function that captures some state from variables defined at the top-level in the file, then I'd do that. Only use singletons when really necessary. Not a big deal though.
Finally, I would not hard-code the range of charges (+whatever to -2). That should be a variable (maybe a constant, or an argument to MultsTable.__init__()
.
Thanks @msricher those are good points. I'll make the fix so the instance get exported. There is room for improvement for sure, still, I'd suggest merging this for now, so that at least for the compilation scripts it can be used to make sure we are generating the right species. |
Ok, that works for me! |
In the last commit I got rid of the |
This function gets the most stable species or ground state (gs) for a guiven Z, charge and the databse with the energies for each combination.
Add multiplicicites table for verification of compilation scripts
Add multiplicicites table for verification of compilation scripts
Add multiplicicites table for verification of compilation scripts
We needed to verify the input multiplicity parameter in the compilation scripts to make sure the requested species matched the one in the available raw data.
This verification is being done differently for every dataset (if done at all). The better approach to do this check was the one implemented in the
nist
dataset, where the multiplicity of the neutral and cationic species was taken from the filedatabase_beta_1.3.0.h5
and for the anions the multiplicity of the isoelectronic species was read from the MULTIPLICITIES table in atomdb.api.This PR adds a table of multiplicities for elements from Hydrogen (Z=1) to Fermium (Z=100) with charges ranging from -2 to Z-1. The values in the table were populated from
database_beta_1.3.0.h5
following the procedure innist
dataset.There is also an utility function to read the value of multiplicity from this table, given the atomic number and charge.
Then, this could be use as the common way to make the verification in all compilation scripts.