Skip to content

BUG: fix setting zero magmoms#3179

Merged
shyuep merged 3 commits into
materialsproject:masterfrom
lbluque:master
Jul 24, 2023
Merged

BUG: fix setting zero magmoms#3179
shyuep merged 3 commits into
materialsproject:masterfrom
lbluque:master

Conversation

@lbluque

@lbluque lbluque commented Jul 23, 2023

Copy link
Copy Markdown
Contributor

Summary

With the new changes that set the default Sepcies.spin to None, I fixed the logic for setting zero magmoms in SpacegroupAnalyzer to check for None values as well.

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

Signed-off-by: lbluque <lbluque@berkeley.edu>
@shyuep

shyuep commented Jul 23, 2023

Copy link
Copy Markdown
Member

Do you mind adding a unittest for one mag structure to check for this? I am worried that someone might make changes in future that breaks this again.

@janosh janosh added fix Bug fix PRs analysis Concerning pymatgen.analysis magmoms Magnetism related labels Jul 24, 2023
@shyuep
shyuep enabled auto-merge (squash) July 24, 2023 16:32
@shyuep

shyuep commented Jul 24, 2023

Copy link
Copy Markdown
Member

Thanks!

@shyuep
shyuep merged commit 4c7e997 into materialsproject:master Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analysis Concerning pymatgen.analysis fix Bug fix PRs magmoms Magnetism related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants