Skip to content

Commit 442d740

Browse files
committed
v2024.3.1
1 parent 83806df commit 442d740

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

docs/CHANGES.md

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pymatgen/io/vasp/sets.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,7 +2902,7 @@ def batch_write_input(
29022902
)
29032903

29042904

2905-
def get_valid_magmom_struct(structure, inplace=True, spin_mode="auto"):
2905+
def get_valid_magmom_struct(structure: Structure, inplace: bool = True, spin_mode: str = "auto") -> Structure:
29062906
"""
29072907
Make sure that the structure has valid magmoms based on the kind of calculation.
29082908
@@ -2943,17 +2943,15 @@ def get_valid_magmom_struct(structure, inplace=True, spin_mode="auto"):
29432943
else:
29442944
mode = spin_mode[0].lower()
29452945

2946-
new_struct = structure.copy() if not inplace else structure
2947-
for site in new_struct:
2946+
ret_struct = structure if inplace else structure.copy()
2947+
for site in ret_struct:
29482948
if mode == "n":
29492949
if "magmom" in site.properties:
29502950
site.properties.pop("magmom")
29512951
elif "magmom" not in site.properties or site.properties["magmom"] is None:
29522952
site.properties["magmom"] = default_values[mode]
29532953

2954-
if not inplace:
2955-
return new_struct
2956-
return None
2954+
return ret_struct
29572955

29582956

29592957
@dataclass

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
setup(
2626
name="pymatgen",
2727
packages=find_namespace_packages(include=["pymatgen.*", "pymatgen.**.*", "cmd_line"]),
28-
version="2024.2.23",
28+
version="2024.3.1",
2929
python_requires=">=3.9",
3030
install_requires=[
3131
"matplotlib>=1.5",

0 commit comments

Comments
 (0)