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
When Geometry sanitizes atoms=[] it returns an empty numpy array of dtype float64. That causes problems because, even though it doesn't contain any indices, arrays don't accept it as an indexer, as it is not of dtype int or bool.
Reproducable code
importsislsisl.geom.graphene().sub(atoms=[])
IndexError Traceback (most recent call last)
<ipython-input-20-053c248b033e> in <module>
----> 1 sisl.geom.graphene().sub(atoms=[])
~/webDevelopement/sislGUI/sisl/sisl/geometry.py in sub(self, atoms, cell)
1701 atoms = self.sc2uc(atoms)
1702 if cell is None:
-> 1703 return self.__class__(self.xyz[atoms, :],
1704 atoms=self.atoms.sub(atoms), sc=self.sc.copy())
1705 return self.__class__(self.xyz[atoms, :],
IndexError: arrays used as indices must be of integer (or boolean) type
When
Geometry
sanitizesatoms=[]
it returns an empty numpy array of dtypefloat64
. That causes problems because, even though it doesn't contain any indices, arrays don't accept it as an indexer, as it is not of dtypeint
orbool
.Reproducable code
The same error is raised by:
(which makes more sense, but still I don't know if this should raise an exception)
but not by:
The text was updated successfully, but these errors were encountered: