예제 #1
0
 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"]
예제 #2
0
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
예제 #3
0
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