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

Add schema for atomate2 classical_md workflows #975

Merged
merged 2 commits into from
Apr 1, 2024

Conversation

orionarcher
Copy link
Contributor

This adds in schema for the nearly complete atomate2.classical workflows in this PR.

The PR is just pydantic schema and no new functionality or dependencies are added.

Contributor Checklist

  • DONE: add atomate2 classical_md schema
  • I have run the tests locally and they passed.
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.01%. Comparing base (5cc66a2) to head (dffb92c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #975   +/-   ##
=======================================
  Coverage   90.01%   90.01%           
=======================================
  Files         138      138           
  Lines       13226    13226           
=======================================
  Hits        11906    11906           
  Misses       1320     1320           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@munrojm munrojm merged commit b826ea3 into materialsproject:main Apr 1, 2024
10 checks passed
Copy link
Collaborator

@rkingsbury rkingsbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is already merged, but as requested in materialsproject/atomate2#782 (comment) I've left some minor comments / suggestions, mostly relating to naming and documentation of various field names.

All are just suggestions, please choose to act on them or not as you judge best. In general I think you've captured all the important aspects that come to mind.

Comment on lines +44 to +46
dir_name: Optional[str] = Field(
None, description="The directory for this VASP task"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo - not "VASP"

None, description="Molecules within the box."
)

forcefield: Optional[str] = Field(None, description="forcefield")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like most of the field names have used a convention of underscores where there would be multiple words. Should this be force_field for consistency?

Comment on lines +56 to +57
interchange: Optional[str] = Field(
None, description="Final output structure from the task"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make more sense to call this structure or trajectory or system or something along those lines (not everyone will be familiar with what an "interchange" is . Or if nothing else, perhaps include as an alias?

calcs_reversed: Optional[list] = Field(
None,
title="Calcs reversed data",
description="Detailed data for each VASP calculation contributing to "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not VASP

Comment on lines +55 to +57
description=(
"The interval for saving simulation state. For no state, set to 0."
),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this carry units? If so, would be nice to specify them in the docstring

Comment on lines +66 to +68
description=(
"The interval for saving trajectory frames. For no trajectory, set to 0."
),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about units. If there are no units and this is the number of timesteps, that would also be good to specify.

Comment on lines +104 to +106
steps: Optional[list[int]] = Field(
None, description="Steps where outputs are reported"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n_steps in input vs. steps in output might be slightly confusing. Would it make sense to use a name like save_every_steps or something to be a little more clear?

Comment on lines +128 to +130
elapsed_time: Optional[float] = Field(
None, description="Elapsed time for the calculation"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to specify units here? Or does it depend on how the calc input is set up?

Comment on lines +184 to +187

has_openmm_completed: Optional[Union[TaskState, bool]] = Field(
None, description="Whether OpenMM completed the calculation successfully"
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field is great to have. I'm not (yet) familiar enough with atomate2 to know if there's a more standard way to report whether the executable has finished. For example you have state in ClassicalMDTaskDocument

If there is not a common standard emerging yet, I'd say it's fine as is.

Comment on lines +38 to +40
class ClassicalMDTaskDocument(BaseModel, extra="allow"): # type: ignore[call-arg]
"""Definition of the OpenMM task document."""

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make any sense to have an ensemble field here? If I recall correctly OpenMM doesn't necessarly enforce a strict ensemble so maybe / maybe not, but thinking generally about classical MD, that's the only significant piece of info that I don't see reflected in the schema.

@orionarcher
Copy link
Contributor Author

Thanks @rkingsbury! I'll integrate this feedback into my next PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants