-
Notifications
You must be signed in to change notification settings - Fork 105
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
Molecule for forcefield #1127
base: main
Are you sure you want to change the base?
Molecule for forcefield #1127
Conversation
1e8c488
to
bfbb00f
Compare
…ent based on the input type of mol_or_struct. change name ForceFieldTaskDocument => ForceFieldStructureTaskDocument output ForceFieldStructureTaskDocument or ForceFieldMoleculeTaskDocument based on type of mol_or_struct update ForceFieldTaskDocument => ForceFieldStructureTaskDocument in the tests import Union from typing include Union in forcefield/md.py take the suggestions from the formatter take ruff's suggestions try again with ruff format ruff format again try again ruff ruff again fix the mypy error Take inputs of both Molecule and Structure update docstring add molecule test for forcefield
bfbb00f
to
6e8c8e0
Compare
Dear @JaGeo, can you help take a look at this PR at your convenience? |
Thank you! I am tagging @utf and @esoteric-ephemera as well as we have to decide how to handle molecular and structural outputs in general. |
Here is my understanding of how to handle molecular and structural outputs. I saw in atomate2, two approaches exist. In FHI-aims, and cp2k engines, their taskdoc inherents from both StructureMetadata, MoleculeMetadata and the output structure takes the same type of the input structure. While, in ase engine, the implementation is to output StructureTaskDoc or MoleculeTaskDoc based on the input structure. Since, the forcefield inherents mostly from ase, I picked the second approach. The FHI-aims/cp2k approach is cleaner in software engineering. However, StructureMetadata and MoleculeMetadata seems to have different symmetry types. I am not sure whether a conflict will happen is symmetry is used. My understanding is to make them fully compatible with each other would require a rework at the emmet-core level. |
Hey @yaoyi92, thanks for making this extension to the forcefields! The split that occurs for I would avoid merging the To @JaGeo's point: we have too many disparate schemas for each code, and it would likely be best to have them originate with the same base document models. Maybe we should start an issue for this? |
@esoteric-ephemera I agree with your points and I also believe we should think about the task docs more broadly. |
Summary
Discussed in #1123. Following the same strategy as ase tasks, output ForceFieldStructureTaskDocument or ForceFieldMoleculeTaskDocument based on the input type of mol_or_struct.
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
ruff
andruff format
on 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 install
and a check will be run prior to allowing commits.