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}")
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]
def parse(self, val): if isinstance(val, int): return val elif isiterable(val): return val else: return super().parse(val)
def parse(self, val): if val is None: return val if not isiterable(val): val = [val] return val
def parse(self, val): if val is None: return val if isiterable(val): return np.array(val, dtype=float) return float(val)