예제 #1
0
 def __init__(self, Z):
     if isiterable(Z):
         self._Z = set(Z)
     else:
         self._Z = set([Z])
     # using a sorted list ensures that we can compare
     super().__init__(f"Z={self._Z}")
예제 #2
0
    def parse(self, val):
        if val is None:
            return val
        elif not isiterable(val):
            self._raise_type_error(val)

        return [self.get_item_input().parse(v) for v in val]
예제 #3
0
 def parse(self, val):
     if isinstance(val, int):
         return val
     elif isiterable(val):
         return val
     else:
         return super().parse(val)
예제 #4
0
    def parse(self, val):
        if val is None:
            return val

        if not isiterable(val):
            val = [val]

        return val
예제 #5
0
파일: number.py 프로젝트: juijan/sisl
 def parse(self, val):
     if val is None:
         return val
     if isiterable(val):
         return np.array(val, dtype=float)
     return float(val)