-
Notifications
You must be signed in to change notification settings - Fork 475
expanding external_potential: parsing, take 2 #3291
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
Conversation
JonathonMisiewicz
left a comment
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.
Yep, that change was what was needed to make the code more readable. There's one more comment I'd like you to add, but otherwise, LGTM.
| else: | ||
| raise ValidationError(f"external_potential: primary or sec keys should be among {mode_keys_list}, not {frag_ep.keys()}. Full input: {external_potential}") | ||
| elif isinstance(frag_ep, list): | ||
| if (w := validate_charge_list(frag_ep)): |
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.
A comment explaining the logic in this if-clause would be helpful.
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.
# list might be new-fangled structure holding one or many among points, diffuse, matrix (the `else` branch), or it might be the outer list of an longstanding list-o-points (the `if` branch), in which case it'll pass the `validate_charge_list` check and needs wrapping in an outer list to match the new-fangled structure.
Sure, I think the above is what's needed. I'll add it to the follow-up PR, as I'd like to get this in since everything needs rebasing against it to fix CI.
Description
replace half of #3272
User API & Changelog headlines
psi4.QMMMbohris further discouraged, and external point charges specification (always in Bohr, regardless of molecule units) now more flexibly takes in lists, numpy arrays, and psi4.core.Matrix es. (It also takes in more arrangements, but none of them will save keystrokes from the point charges case.)Dev notes & details
QMMMbohr()will raise a FutureWarning now-m externruns all EP tests.extern.cclooks like a lot of changes, but it's really just hiding a block behindif (charges_.size()) {...}which is future prep.Questions
Checklist
Status