-
Notifications
You must be signed in to change notification settings - Fork 70
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
Mass validation & mtol #262
Comments
Or at least maybe print a warning msg, or raise an exception when mass_number = -1 i.e. qcel could not guess the "most probable" mass number? |
Don't turn off validate. That's giving a generic per atom
What is the use case here? Are you populating from a program with an old, fixed set of atomic masses? and then mass number is also needed? If what you want is modern masses while still preserving isotope info, perhaps initialize with mass_number=int(old_mass). |
The correct way to make this work is with something like the below. (That gets you through creation, but more tweaks needed for to_string, etc.) I'd still like to hear more about how this situation is coming about.
|
Yes, that is exactly my case. I am using a molecule created by a bunch of different codes, convert it into qcelemental.Molecule, which is then passed to QCEngine. I don't need the mass numbers for now so I ended up removing them from my pipeline after I realized I was getting negative values. Doing |
Describe the bug
Cannot construct a valid molecule with specified masses.
To Reproduce
QCElemental couldn't guess the mass number to be 16 likely due to the relatively small
mtol
(1e-3) set inreconcile_nucleus()
andfrom_schema()
, so if we specify the mass number, we get a validation error:Expected behavior
To get the right mass number or avoid any errors, we can either turn off validation (which is not recommended), or add a keyword arg
mtol
toMolecule.__init__
and increase the value of this number, but neither approach is elegant or adequate for passing "oxy" to qcengine for e.g. (sincemtol
is not part of the Molecule schema or used by qcengine AFAIK).What is the easiest way to solve this with minimal effort? Turn off mass validation by default? Make
mtol
adaptive?Additional context
Passing the keyword
nonphysical
toMolecule
does not solve the problem.qcel v0.19.0.
The text was updated successfully, but these errors were encountered: