def _get_dtype(self): """ This is a temporal fix because for some reason some sile classes can not be pickled """ if hasattr(self, "_required_attrs"): return tuple(sisl.get_siles(attrs=self._required_attrs)) else: return self.__dict__["dtype"]
class GeometryInput(SislObjectInput): _dtype = (str, sisl.Geometry, *sisl.get_siles(attrs=['read_geometry'])) def parse(self, val): if isinstance(val, str): val = sisl.get_sile(val) if isinstance(val, sisl.io.Sile): val = val.read_geometry() return val
class GeometryInput(SislObjectInput): dtype = (sisl.Geometry, "sile (or path to file) that contains a geometry") _dtype = (str, sisl.Geometry, *sisl.get_siles(attrs=['read_geometry'])) def parse(self, val): if isinstance(val, (str, Path)): val = sisl.get_sile(val) if isinstance(val, sisl.io.BaseSile): val = val.read_geometry() return val