You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently to ESPEI's fixed configuration datasets, sublattices occupied only by an endmember are represented as not wrapped in a tuple. For example, consider a phase with sublattice model (A,B):(C,D), the following is the behavior:
("A", "C") refers to the endmember A:B
(("A", "B"), "C") refers to A and B mixing on the first sublattice, with the only C occupying the second sublattice
(("A", "B"), ("C", "D")) refers to mixing in both sublattices
(notably) (("A", "B"), ("C",)) is not properly recognized as C being the only species to occupy the second sublattice, even though a user would expect it to be treated equivalently to the (("A", "B"), "C") case.
As a temporary solution, we could make espei.sublattice_tools.canonicalize unwrap the singly-occupied sublattices, e.g. (("A", "B"), ("C",)) -> (("A", "B"), "C"). That change should be localized and not have any ranging implications in the codebase.
Arguably, the correct approach would be that every sublattice configuration is typed as a Tuple[Tuple[str | Species]], rather than what we have now which is a Tuple[(str | Species) | Tuple[str | species]]. The latter could initially trigger a Warning as deprecated behavior, and later raise an Exception. We could implement that in espei.sublattice_tools.canonicalize to do the conversion and warn/raise about the correctness issue (and include something in the dataset checker to handle that). Making that change will require some changes throughout the code to make sure internally ESPEI represents endmembers as singly-occupied tuples in a sublattice configuration.
The text was updated successfully, but these errors were encountered:
Currently to ESPEI's fixed configuration datasets, sublattices occupied only by an endmember are represented as not wrapped in a tuple. For example, consider a phase with sublattice model
(A,B):(C,D)
, the following is the behavior:("A", "C")
refers to the endmemberA:B
(("A", "B"), "C")
refers to A and B mixing on the first sublattice, with the only C occupying the second sublattice(("A", "B"), ("C", "D"))
refers to mixing in both sublattices(("A", "B"), ("C",))
is not properly recognized as C being the only species to occupy the second sublattice, even though a user would expect it to be treated equivalently to the(("A", "B"), "C")
case.As a temporary solution, we could make
espei.sublattice_tools.canonicalize
unwrap the singly-occupied sublattices, e.g.(("A", "B"), ("C",))
->(("A", "B"), "C")
. That change should be localized and not have any ranging implications in the codebase.Arguably, the correct approach would be that every sublattice configuration is typed as a
Tuple[Tuple[str | Species]]
, rather than what we have now which is aTuple[(str | Species) | Tuple[str | species]]
. The latter could initially trigger a Warning as deprecated behavior, and later raise an Exception. We could implement that inespei.sublattice_tools.canonicalize
to do the conversion and warn/raise about the correctness issue (and include something in the dataset checker to handle that). Making that change will require some changes throughout the code to make sure internally ESPEI represents endmembers as singly-occupied tuples in a sublattice configuration.The text was updated successfully, but these errors were encountered: