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

Fix MPMD set bug #3355

Merged
merged 3 commits into from
Sep 27, 2023
Merged

Fix MPMD set bug #3355

merged 3 commits into from
Sep 27, 2023

Conversation

MichaelWolloch
Copy link
Contributor

Summary

Small bugfix for the MPMD vasp input set. The input parameter time_step was added in fabdd27 (it was in the docstring before that), but it was not added as a class attribute, leading to an NotImplementedError raised when trying to convert the object to a dict:

NotImplementedError: Unable to automatically determine as_dict format from class. MSONAble requires all args to be present as either self.argname or self._argname, and kwargs to be present under a self.kwargs variable to automatically determine the dict format. Alternatively, you can implement both as_dict and from_dict.

Major changes:

  • feature 1: time_step is now usable and is passed on to POTIM. It defaults to None, in which case, the MPMDSet behaves as previously and POTIM is set to 0.5fs for compounds containing hydrogen, 2fs for anything else.
  • fix 1: time_step is now also a class attribute, making the set MSONAble.

Both the time steps, as well as the dict conversion are tested in a new unit test for the MPMD set.

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

@shyuep shyuep merged commit 580a241 into materialsproject:master Sep 27, 2023
21 checks passed
@shyuep
Copy link
Member

shyuep commented Sep 27, 2023

Thanks

@janosh janosh added io Input/output functionality fix Bug fix PRs vasp Vienna Ab initio Simulation Package labels Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix PRs io Input/output functionality vasp Vienna Ab initio Simulation Package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants