-
Notifications
You must be signed in to change notification settings - Fork 89
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 overriding magmoms
in update_user_incar_settings()
#375
Conversation
use Final for _VFILES ref_path must be Path, str would raise since doesn't implement div operator
magmoms
in update_user_incar_settings()
Thanks @janosh. I think this might need a bit more thought. Previously the magmom precedence was:
The actual precedence for magmoms should be:
However, this PR has the order
That's because the config dict is updated with atomate2/src/atomate2/vasp/sets/base.py Lines 611 to 614 in 6c541cd
And here: atomate2/src/atomate2/vasp/sets/base.py Line 620 in 6c541cd
SolutionTo get the right precedence, one thing we could do is:
It would also be nice to update the precedence of how magmoms are set in both the docstring |
@utf Thanks for the quick feedback. By config dict magmoms, you mean |
Yes, although this should be before the incar_settings = dict(self.config_dict["INCAR"])
base_magmoms = incar_settings.get("MAGMOM", {})
# apply user incar settings to SETTINGS not to INCAR
_apply_incar_updates(incar_settings, self.user_incar_settings) |
Lunch now! I'll do the docs update later. |
E TypeError: 'type' object is not subscriptable
def test_get_magmoms(base_magmoms: dict[str, float]) -> None: E TypeError: 'type' object is not subscriptable
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #375 +/- ##
==========================================
+ Coverage 64.74% 64.85% +0.10%
==========================================
Files 74 74
Lines 7157 7161 +4
Branches 938 939 +1
==========================================
+ Hits 4634 4644 +10
+ Misses 2224 2220 -4
+ Partials 299 297 -2
|
Closes #374.
This PR gives
magmoms
passed to_get_magmoms()
precedence over magmoms already in the structure.It also adds a test for
_get_magmoms()
.