Skip to content

Commit

Permalink
MagneticStructureEnumerator: Expose max_orderings as a keyword ar…
Browse files Browse the repository at this point in the history
…gument (#4304)

This was previously obscured by a hard-coded `num_orderings` class attribute.
  • Loading branch information
mkhorton authored Feb 25, 2025
1 parent 195f19e commit 03bcbf5
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 03bcbf5

Please sign in to comment.