def add_attr(self, logging=True, **kwargs): """ Similar as config, but add a new attribute. """ self._attrs_registered.extend(kwargs.keys()) pyclass.set_object_attributes(self, append=True, logging=logging, **kwargs)
def config(self, logging=True, **kwargs): """ Configure the variable attributes. If the attribute is not the default attributes, return error. :param logging: If True, show logging. :param kwargs: A dictionary of the attributes. :return: None """ pyclass.set_object_attributes(self, append=False, logging=logging, **kwargs)
def config(self, logging: bool = True, **kwargs) -> None: """ Configure the attributes of the dataset. :param logging: Show logging if True. :param kwargs: :return: """ pyclass.set_object_attributes(self, append=False, logging=logging, **kwargs)
def visual(self, value): if value == 'new': self._visual = Visual(variable=self) elif value == 'on': if not isinstance(self._visual, Visual): self.visual = 'new' elif isinstance(value, Visual): self._visual = value elif type(value) is dict: if not isinstance(self._visual, Visual): self.visual = 'new' pyclass.set_object_attributes(self.visual, append=False, logging=True, **value) elif value == 'off': self._visual = None else: raise ValueError
def config(self, logging=True, **kwargs): pyclass.set_object_attributes(self, append=False, logging=logging, **kwargs)
def add_attr(self, logging=True, **kwargs): pyclass.set_object_attributes(self, append=True, logging=logging, **kwargs)