-
Notifications
You must be signed in to change notification settings - Fork 133
forcefields: allow specifying custom calculator in forcefield makers #1362
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
forcefields: allow specifying custom calculator in forcefield makers #1362
Conversation
| There are predefined "recipes" for generating `InputSets` tailored to specific tasks like structural relaxation or the band structure calculation and more, that are provided as `InputGenerator` classes. | ||
|
|
||
| ## Technical Aspects | ||
| ### Technical Aspects |
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.
This is not an essential fix to the PR itself
|
I have confirmed test-force-field-notebook passes, but I have no idea why |
|
@lan496 Yeah, it has nothing to do with your PR. I have restarted the tests manually. |
3ae94d4 to
30a4b0f
Compare
|
@lan496 thanks! One more question: what happens if the phonon maker is not initalized via the |
|
For |
|
@esoteric-ephemera I will merge. It is backwards compatible and should work well with all previous examples. Feel free to comment more after the holidays in case I overlooked anything. |
|
@lan496 Thank you! I will merge! |
|
@JaGeo Thank you so much! |
Summary
atomate2.forcefields.utils.ase_calculatoratForceFieldMixin.force_fields_nameparameter. This will be useful to integrateatomate2.forcefieldswith recently released MLIPs or in-house developed MLIPs.docs/user/codes/forcefields.mdBackward compatibility
The following table summarizes the stored attributes in Maker and schemas for forcefields.
For str or
MLFFinput, the behavior does not change.For a dict input,
MLFFto keep the other behaviorForceFieldMixin.calculator_metaparameter (initialized in__post_init__) is newly introduced to remember the dict informationForceFieldMixin.ase_calculator_nameproperty is newly introduced to keep schemas forForceFieldMeta.forcefield_name. Lettingcalc_clsbe a decoded calculator function from the dict,calc_cls.__name__is storedcalc_cls.__module__{"@module": "chgnet.model.dynamics", "@callable": "CHGNetCalculator"}__post__init__{"@module": "chgnet.model.dynamics", "@callable": "CHGNetCalculator"}Checklist
Work-in-progress pull requests are encouraged, but please put [WIP] in the pull request
title.
Before a pull request can be merged, the following items must be checked:
The easiest way to handle this is to run the following in the correct sequence on
your local machine. Start with running
ruffandruff formaton your new code. This willautomatically reformat your code to PEP8 conventions and fix many linting issues.
Run ruff on your code.
type check your code.
Note that the CI system will run all the above checks. But it will be much more
efficient if you already fix most errors prior to submitting the PR. It is highly
recommended that you use the pre-commit hook provided in the repository. Simply run
pre-commit installand a check will be run prior to allowing commits.