-
Notifications
You must be signed in to change notification settings - Fork 8
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 table potential class to forcefields library #65
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
==========================================
- Coverage 93.75% 93.54% -0.22%
==========================================
Files 20 20
Lines 1410 1533 +123
==========================================
+ Hits 1322 1434 +112
- Misses 88 99 +11
|
pair_dict[pair_type] = dict() | ||
pair_dict[pair_type]["U"] = table[:, 1] | ||
pair_dict[pair_type]["F"] = table[:, 2] | ||
if len(r_min) != len(r_max) != 1: |
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.
Technically, we can handle pair tables with different r_mins and r_maxs if we set the rmax on a per-pair basis in _create_forcefield
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.
Everything looks good. I just added a few comments mostly around checks and validations when loading the files, which I think you already have those in mind.
Thank you
bonds: dict, optional, default None | ||
angles: dict, optional, default None | ||
dihedrals: dict, optional, default None | ||
|
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.
probably it's worth mentioning r_min
in the docstrings. I think it's the first time we have it in hoomd-organics
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.
Yeah, I forgot that I need to finish this part of the doc strings still.
This PR adds a class that creates hoomd table potentials. In hoomd, the table potentials are just created from arrays (i.e. you don't give hoomd the txt or npy file). So, this class is designed to accept dictionaries of
{type: {}}
where the inside dictionary has keys and values of{parameter: parameter_value}
for all of the hoomd parameters (force, energy, etc...). However, since the use case is most commonly going to be loading table potential files, I added afrom_files
class method that handles building up of the these dictionaries.To Do: