Skip to content

Commit d56333f

Browse files
committed
MagneticStructureEnumerator: Expose max_orderings as a keyword argument
This was previously obscured by a hard-coded `num_orderings` class attribute.
1 parent 1b8c5f8 commit d56333f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/pymatgen/analysis/magnetism/analyzer.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ def __init__(
620620
),
621621
automatic: bool = True,
622622
truncate_by_symmetry: bool = True,
623+
max_orderings: int | None = 64,
623624
transformation_kwargs: dict | None = None,
624625
) -> None:
625626
"""Generate different collinear magnetic orderings for a given input structure.
@@ -643,6 +644,7 @@ def __init__(
643644
automatic (bool): if True, will automatically choose sensible strategies
644645
truncate_by_symmetry (bool): if True, will remove very unsymmetrical
645646
orderings that are likely physically implausible
647+
max_orderings (int): the maximum number of structures to return
646648
transformation_kwargs: keyword arguments to pass to
647649
MagOrderingTransformation, to change automatic cell size limits, etc.
648650
"""
@@ -662,7 +664,7 @@ def __init__(
662664
self.truncate_by_symmetry = truncate_by_symmetry
663665

664666
# other settings
665-
self.num_orderings = 64
667+
self.num_orderings = max_orderings
666668
self.max_unique_sites = 8
667669

668670
# kwargs to pass to transformation (ultimately to enumlib)

0 commit comments

Comments
 (0)