Skip to content
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

MagneticStructureEnumerator: Expose max_orderings as a keyword argument #4304

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/pymatgen/analysis/magnetism/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ def __init__(
),
automatic: bool = True,
truncate_by_symmetry: bool = True,
max_orderings: int | None = 64,
transformation_kwargs: dict | None = None,
) -> None:
"""Generate different collinear magnetic orderings for a given input structure.
Expand All @@ -643,6 +644,7 @@ def __init__(
automatic (bool): if True, will automatically choose sensible strategies
truncate_by_symmetry (bool): if True, will remove very unsymmetrical
orderings that are likely physically implausible
max_orderings (int): the maximum number of structures to return
transformation_kwargs: keyword arguments to pass to
MagOrderingTransformation, to change automatic cell size limits, etc.
"""
Expand All @@ -662,7 +664,7 @@ def __init__(
self.truncate_by_symmetry = truncate_by_symmetry

# other settings
self.num_orderings = 64
self.num_orderings = max_orderings
self.max_unique_sites = 8

# kwargs to pass to transformation (ultimately to enumlib)
Expand Down