Skip to content

Commit 72688df

Browse files
committed
don't use entrylike
1 parent ab75122 commit 72688df

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/pymatgen/analysis/phase_diagram.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from numpy.typing import ArrayLike
4444
from typing_extensions import Self
4545

46-
from pymatgen.util.typing import CompositionLike, EntryLike
46+
from pymatgen.util.typing import CompositionLike
4747

4848
logger = logging.getLogger(__name__)
4949

@@ -343,7 +343,7 @@ class PhaseDiagram(MSONable):
343343

344344
def __init__(
345345
self,
346-
entries: Collection[EntryLike],
346+
entries: Collection[Entry],
347347
elements: Collection[Element] = (),
348348
*,
349349
computed_data: dict[str, Any] | None = None,
@@ -455,9 +455,9 @@ def _compute(self) -> dict[str, Any]:
455455

456456
entries = sorted(self.entries, key=lambda e: e.composition.reduced_composition)
457457

458-
el_refs: dict[Element, EntryLike] = {}
459-
min_entries: list[EntryLike] = []
460-
all_entries: list[EntryLike] = []
458+
el_refs: dict[Element, Entry] = {}
459+
min_entries: list[Entry] = []
460+
all_entries: list[Entry] = []
461461
for composition, group_iter in itertools.groupby(entries, key=lambda e: e.composition.reduced_composition):
462462
group = list(group_iter)
463463
min_entry = min(group, key=lambda e: e.energy_per_atom)
@@ -1436,7 +1436,7 @@ class GrandPotentialPhaseDiagram(PhaseDiagram):
14361436

14371437
def __init__(
14381438
self,
1439-
entries: Collection[EntryLike],
1439+
entries: Collection[Entry],
14401440
chempots: dict[Element, float],
14411441
elements: Collection[Element] | None = None,
14421442
*,
@@ -1447,7 +1447,7 @@ def __init__(
14471447
TODO: update serialization here.
14481448
14491449
Args:
1450-
entries (Sequence[EntryLike]): A list of EntryLike objects having an
1450+
entries (Sequence[Entry]): A list of Entry objects having an
14511451
energy, energy_per_atom and composition.
14521452
chempots (dict[Element, float]): Specify the chemical potentials
14531453
of the open elements.
@@ -1518,7 +1518,7 @@ class CompoundPhaseDiagram(PhaseDiagram):
15181518

15191519
def __init__(
15201520
self,
1521-
entries: Sequence[EntryLike],
1521+
entries: Sequence[Entry],
15221522
terminal_compositions: Sequence[Composition],
15231523
normalize_terminal_compositions: bool = True,
15241524
):
@@ -1573,7 +1573,7 @@ def num2str(num):
15731573
return ret
15741574

15751575
def transform_entries(
1576-
self, entries: Sequence[EntryLike], terminal_compositions: Sequence[Composition]
1576+
self, entries: Sequence[Entry], terminal_compositions: Sequence[Composition]
15771577
) -> tuple[list[TransformedPDEntry], dict[Composition, DummySpecies]]:
15781578
"""
15791579
Method to transform all entries to the composition coordinate in the
@@ -1668,7 +1668,7 @@ class PatchedPhaseDiagram(PhaseDiagram):
16681668

16691669
def _compute(
16701670
self,
1671-
entries: Sequence[EntryLike] | set[EntryLike],
1671+
entries: Sequence[Entry] | set[Entry],
16721672
elements: Sequence[Element] | None = None,
16731673
keep_all_spaces: bool = False,
16741674
verbose: bool = False,
@@ -1677,7 +1677,7 @@ def _compute(
16771677
Compute the phase diagram data for PatchedPhaseDiagram.
16781678
16791679
Args:
1680-
entries: A list of EntryLike objects.
1680+
entries: A list of Entry objects.
16811681
elements: Optional list of elements in the phase diagram.
16821682
keep_all_spaces: Whether to keep chemical spaces that are subspaces of other spaces.
16831683
verbose: Whether to show progress bar during convex hull construction.
@@ -1692,9 +1692,9 @@ def _compute(
16921692

16931693
entries = sorted(entries, key=lambda e: e.composition.reduced_composition)
16941694

1695-
el_refs: dict[Element, EntryLike] = {}
1696-
min_entries: list[EntryLike] = []
1697-
all_entries: list[EntryLike] = []
1695+
el_refs: dict[Element, Entry] = {}
1696+
min_entries: list[Entry] = []
1697+
all_entries: list[Entry] = []
16981698
for composition, group_iter in itertools.groupby(entries, key=lambda e: e.composition.reduced_composition):
16991699
group = list(group_iter)
17001700
min_entry = min(group, key=lambda e: e.energy_per_atom)
@@ -1778,7 +1778,7 @@ def _compute(
17781778

17791779
def __init__(
17801780
self,
1781-
entries: Sequence[EntryLike] | set[EntryLike],
1781+
entries: Sequence[Entry] | set[Entry],
17821782
elements: Sequence[Element] | None = None,
17831783
keep_all_spaces: bool = False,
17841784
verbose: bool = False,
@@ -1787,7 +1787,7 @@ def __init__(
17871787
) -> None:
17881788
"""
17891789
Args:
1790-
entries (Sequence[EntryLike] | set[EntryLike]): A list of EntryLike objects having an
1790+
entries (Sequence[Entry] | set[Entry]): A list of Entry objects having an
17911791
energy, energy_per_atom and composition.
17921792
elements (Sequence[Element], optional): Optional list of elements in the phase
17931793
diagram. If set to None, the elements are determined from
@@ -2205,7 +2205,7 @@ def remove_redundant_spaces(
22052205
# get_decomp_and_phase_separation_energy(),
22062206
# get_phase_separation_energy()
22072207

2208-
def get_pd_for_entry(self, entry: EntryLike | Composition) -> PhaseDiagram:
2208+
def get_pd_for_entry(self, entry: Entry | Composition) -> PhaseDiagram:
22092209
"""Get the possible phase diagrams for an entry.
22102210
22112211
Args:

0 commit comments

Comments
 (0)