diff --git a/src/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py b/src/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py index 562b7b8c987..86c5d0f118a 100644 --- a/src/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py +++ b/src/pymatgen/analysis/chemenv/coordination_environments/coordination_geometry_finder.py @@ -218,7 +218,9 @@ def points_wcs_csc(self, permutation=None): """ if permutation is None: return self._points_wcs_csc - return np.concatenate((self._points_wcs_csc[:1], self._points_wocs_csc.take(permutation, axis=0))) + return np.concatenate( + (self._points_wcs_csc[:1], self._points_wocs_csc.take(np.array(permutation, dtype=np.intp), axis=0)) + ) def points_wocs_csc(self, permutation=None): """ @@ -227,7 +229,7 @@ def points_wocs_csc(self, permutation=None): """ if permutation is None: return self._points_wocs_csc - return self._points_wocs_csc.take(permutation, axis=0) + return self._points_wocs_csc.take(np.array(permutation, dtype=np.intp), axis=0) def points_wcs_ctwcc(self, permutation=None): """ @@ -239,7 +241,7 @@ def points_wcs_ctwcc(self, permutation=None): return np.concatenate( ( self._points_wcs_ctwcc[:1], - self._points_wocs_ctwcc.take(permutation, axis=0), + self._points_wocs_ctwcc.take(np.array(permutation, dtype=np.intp), axis=0), ) ) @@ -250,7 +252,7 @@ def points_wocs_ctwcc(self, permutation=None): """ if permutation is None: return self._points_wocs_ctwcc - return self._points_wocs_ctwcc.take(permutation, axis=0) + return self._points_wocs_ctwcc.take(np.array(permutation, dtype=np.intp), axis=0) def points_wcs_ctwocc(self, permutation=None): """ @@ -262,7 +264,7 @@ def points_wcs_ctwocc(self, permutation=None): return np.concatenate( ( self._points_wcs_ctwocc[:1], - self._points_wocs_ctwocc.take(permutation, axis=0), + self._points_wocs_ctwocc.take(np.array(permutation, dtype=np.intp), axis=0), ) ) @@ -273,7 +275,7 @@ def points_wocs_ctwocc(self, permutation=None): """ if permutation is None: return self._points_wocs_ctwocc - return self._points_wocs_ctwocc.take(permutation, axis=0) + return self._points_wocs_ctwocc.take(np.array(permutation, dtype=np.intp), axis=0) @property def cn(self): @@ -1976,6 +1978,7 @@ def _cg_csm_separation_plane_optim2( stop_search = False # TODO: do not do that several times ... also keep in memory if sepplane.ordered_plane: + separation_indices = [arr.astype(np.intp) for arr in separation_indices] inp = self.local_geometry.coords.take(separation_indices[1], axis=0) if sepplane.ordered_point_groups[0]: pp_s0 = self.local_geometry.coords.take(separation_indices[0], axis=0)