Skip to content

Commit c621d44

Browse files
fix icet kwargs (#4530)
Co-authored-by: Shyue Ping Ong <[email protected]>
1 parent 7134328 commit c621d44

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/pymatgen/io/icet.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,16 @@ def get_icet_sqs_obj(self, material: Atoms | Structure, cluster_space: _ClusterS
218218
material = AseAtomsAdaptor.get_atoms(material)
219219

220220
cluster_space = cluster_space or self._get_cluster_space()
221+
222+
orb_data_as_list = None
223+
if hasattr(cluster_space, "orbit_data"): # icet <= 2
224+
orb_data_as_list = cluster_space.orbit_data
225+
elif hasattr(cluster_space, "as_list"): # icet >= 3
226+
orb_data_as_list = cluster_space.as_list
221227
return compare_cluster_vectors(
222-
cv_1=cluster_space.get_cluster_vector(material),
223-
cv_2=self.sqs_vector,
224-
orbit_data=cluster_space.orbit_data,
228+
cluster_space.get_cluster_vector(material),
229+
self.sqs_vector,
230+
orb_data_as_list,
225231
**self._sqs_obj_kwargs,
226232
)
227233

0 commit comments

Comments
 (0)