Skip to content

Commit

Permalink
Merge pull request #412 from qchempku2017/main
Browse files Browse the repository at this point in the history
Fix #411
  • Loading branch information
lbluque authored Sep 13, 2023
2 parents 1ae4758 + 63a88b1 commit 3b538fc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
numpy==1.24.4
monty==2023.9.5
pymatgen==2023.8.10
pymatgen==2023.9.10
4 changes: 1 addition & 3 deletions smol/cofe/space/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,7 @@ def from_dict(cls, d):
{
spec
if spec.symbol not in symbols
else Vacancy(
spec.symbol, spec.oxidation_state, spec.properties
): val
else Vacancy(spec.symbol, spec.oxidation_state, spec.spin): val
for spec, val in site.species.items()
if spec.symbol not in symbols
}
Expand Down
7 changes: 2 additions & 5 deletions smol/cofe/space/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ def __init__(
self,
symbol: str = "A",
oxidation_state: float = 0,
properties: dict | None = None,
spin: float | None = None,
):
"""Initialize a Vacancy.
Expand All @@ -256,13 +255,11 @@ def __init__(
because Vac contains V, a valid Element.
oxidation_state (float): oxidation state for Vacancy. More like
the charge of a point defect. Defaults to zero.
properties (dict): Deprecated. See pymatgen 2023.6.28 release notes.
spin: Spin associated with Species. Defaults to None.
"""
super().__init__(
symbol=symbol,
oxidation_state=oxidation_state,
properties=properties,
spin=spin,
)

Expand All @@ -286,8 +283,8 @@ def __repr__(self):

def __copy__(self):
"""Copy the vacancy object."""
return Vacancy(self.symbol, self._oxi_state)
return Vacancy(self.symbol, self._oxi_state, self.spin)

def __deepcopy__(self, memo):
"""Deepcopy the vacancy object."""
return Vacancy(self.symbol, self._oxi_state)
return Vacancy(self.symbol, self._oxi_state, self.spin)

0 comments on commit 3b538fc

Please sign in to comment.