Skip to content

Commit

Permalink
v2024.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Mar 1, 2024
1 parent 83806df commit 442d740
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 7 deletions.
45 changes: 45 additions & 0 deletions docs/CHANGES.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions pymatgen/io/vasp/sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2902,7 +2902,7 @@ def batch_write_input(
)


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

new_struct = structure.copy() if not inplace else structure
for site in new_struct:
ret_struct = structure if inplace else structure.copy()
for site in ret_struct:
if mode == "n":
if "magmom" in site.properties:
site.properties.pop("magmom")
elif "magmom" not in site.properties or site.properties["magmom"] is None:
site.properties["magmom"] = default_values[mode]

if not inplace:
return new_struct
return None
return ret_struct


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
setup(
name="pymatgen",
packages=find_namespace_packages(include=["pymatgen.*", "pymatgen.**.*", "cmd_line"]),
version="2024.2.23",
version="2024.3.1",
python_requires=">=3.9",
install_requires=[
"matplotlib>=1.5",
Expand Down

0 comments on commit 442d740

Please sign in to comment.