def create(cls, *atoms): """ Creates the label if it doesn't exist. """ atomids = tuple(a.index for a in atoms) molids = tuple(a.molecule.molid for a in atoms) _label.add(cls._category, molids, atomids) return cls(*atoms)
def update(self): """ Updates the values of the 'on' and 'value' attributes for this label. """ self.__dict__.update(label.add(self.type, self.molid, self.atomid))
def __init__(self, type, molid, atomid): self.type = type self.__dict__.update(label.add(self.type, molid, atomid))