Skip to content

Conversation

@atulcthakur
Copy link
Contributor

Summary

When auto_dipole=True, MVLSlabSet was passing a NumPy array into the INCAR’s DIPOL tag, causing pymatgen to serialize it with brackets (e.g. DIPOL = [0.1 0.2 0.3]). VASP expects three space‑separated floats without any brackets: https://www.vasp.at/wiki/index.php/DIPOL.
This PR converts the computed center‑of‑mass array into a plain Python list[float] (via .tolist()), ensuring the INCAR writes
DIPOL = 0.1 0.2 0.3
instead of
DIPOL = [0.1 0.2 0.3]
which errors out with the recent VASP 6.4.

Major changes:

  • fix 1: In MVLSlabSet.incar_updates, replace center_of_mass (a NumPy array) with a pure python list = com.tolist()

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)

Tip: Install pre-commit hooks to auto-check types and linting before every commit:

pip install -U pre-commit
pre-commit install

@shyuep shyuep enabled auto-merge (squash) April 17, 2025 18:08
@shyuep
Copy link
Member

shyuep commented Apr 17, 2025

Add a unit test pls.

auto-merge was automatically disabled April 17, 2025 21:31

Head branch was pushed to by a user without write access

@shyuep shyuep enabled auto-merge (squash) April 17, 2025 21:44
@shyuep shyuep disabled auto-merge April 18, 2025 02:58
@shyuep shyuep enabled auto-merge (squash) April 18, 2025 02:59
@shyuep shyuep disabled auto-merge April 18, 2025 02:59
@shyuep shyuep merged commit 589b6b2 into materialsproject:master Apr 18, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants