Skip to content
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

Partial, formal, and total charges are reported with inconsistent units #465

Closed
jchodera opened this issue Nov 30, 2019 · 2 comments · Fixed by #471
Closed

Partial, formal, and total charges are reported with inconsistent units #465

jchodera opened this issue Nov 30, 2019 · 2 comments · Fixed by #471

Comments

@jchodera
Copy link
Member

jchodera commented Nov 30, 2019

The current version of the toolkit reports partial, formal, and total charges with inconsistent units:

>> from openforcefield.topology import Molecule
>>> molecule = Molecule.from_smiles('c1ccccc1')
>>> molecule.total_charge
0
>>> molecule.atoms[0].formal_charge
0
>>> molecule.atoms[0].partial_charge
Quantity(value=0.0, unit=elementary charge)
>>> molecule.partial_charges
Quantity(value=array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]), unit=elementary charge)

Instead, we should presumably adopt a consistent output format (with or without units) for all charge-related quantities.

j-wags added a commit that referenced this issue Dec 11, 2019
@j-wags
Copy link
Member

j-wags commented Dec 17, 2019

Good catch. #471 will standardize to report partial and formal charges in units of elementary charge.

@j-wags
Copy link
Member

j-wags commented Jan 3, 2020

I'm also making the setter for Atom.formal_charge accept int or Quantity, since there's a good argument for both. All getters will return Quantity, and all other setters will require Quantity.

@j-wags j-wags modified the milestones: 0.6.1, 0.7.0 Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants