Skip to content

Commit

Permalink
More type hint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhorton committed Sep 25, 2019
1 parent e2ffc65 commit cfa48b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pymatgen/analysis/magnetism/analyzer.py
Expand Up @@ -731,7 +731,7 @@ def __init__(
self.default_magmoms = default_magmoms

# different strategies to attempt, default is usually reasonable
self.strategies = strategies
self.strategies = list(strategies)
# and whether to automatically add strategies that may be appropriate
self.automatic = automatic

Expand Down Expand Up @@ -915,28 +915,28 @@ def _generate_transformations(
structure.add_site_property("wyckoff", wyckoff)
wyckoff_symbols = set(wyckoff) - {"n/a"}

# if user doesn't specifically request ferrimagnetic_Cr2NiO4 orderings,
# if user doesn't specifically request ferrimagnetic orderings,
# we apply a heuristic as to whether to attempt them or not
if self.automatic:
if (
"ferrimagnetic_by_motif" not in self.strategies
and len(wyckoff_symbols) > 1
and len(types_mag_species) == 1
):
self.strategies += ("ferrimagnetic_by_motif",)
self.strategies += ["ferrimagnetic_by_motif"]

if (
"antiferromagnetic_by_motif" not in self.strategies
and len(wyckoff_symbols) > 1
and len(types_mag_species) == 1
):
self.strategies += ("antiferromagnetic_by_motif",)
self.strategies += ["antiferromagnetic_by_motif"]

if (
"ferrimagnetic_by_species" not in self.strategies
and len(types_mag_species) > 1
):
self.strategies += ("ferrimagnetic_by_species",)
self.strategies += ["ferrimagnetic_by_species"]

# we start with a ferromagnetic ordering
if "ferromagnetic" in self.strategies:
Expand All @@ -954,7 +954,7 @@ def _generate_transformations(

# we store constraint(s) for each strategy first,
# and then use each to perform a transformation later
all_constraints: Dict[str, List[Union[float, MagOrderParameterConstraint]]] = {}
all_constraints: Dict[str, List[Any]] = {}

# ...to which we can add simple AFM cases first...
if "antiferromagnetic" in self.strategies:
Expand Down

0 comments on commit cfa48b7

Please sign in to comment.