-
Notifications
You must be signed in to change notification settings - Fork 32
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
account for charges in convert_mbuild.py
#679
Comments
EDIT: After messing around a bit I answered my own question. I'm kind of confused how default values are handled with pydantic. Is the correct place to define default values for attributes in the For example:
Would become:
|
As far as I'm aware, this is the change you would want. However, I do think it is better to leave at least the default values to For instance, I think in this function we just need to be checking for charges, and assigning them to the atom. |
Yeah, I agree that leaving the default as |
Yeah, having charge default to |
Ok, that makes sense. I guess the question remains if |
If they're there in mBuild, they should be assigned to the GMSO topology. That is certainly the case, not having that converted is a bug. |
I think we should carry it over given that those parameters are set in the mBuild Compound (but I am not sure what's the default value for those two fields over mbuild, need to double check). My point of view is that if those values have been set by the user and is part of the particle/bead (not atomtype), they should be brought over and take precedent that the values specified in their atomtypes, but also avoid having default to a logically correct value (0 for charge). |
Just checked, and currently, both charge and mass is default to 0 in mbuild, I think we should change those to |
That change sounds better to me. It may break some of the current mBuild writers though, so we'll have to keep an eye on that in the PR. |
I will start a PR to do that and see how many things break |
addressed in mosdef-hub/mbuild#1047 and #680 |
Related to #664 and #678
site.charge
defaults toNone
which might cause issues for some of the writers (e.g.write_gsd
)I think
site.charge
should default to 0 when not set, and we should look through the convert functions ingmso.external
to make suresite.charge
is being populated correctly when the information is available.The text was updated successfully, but these errors were encountered: