Source code for fdi.dataset.annotatable

# -*- coding: utf-8 -*-

import logging

logger = logging.getLogger(__name__)


[docs]class Annotatable(): """ An Annotatable object is an object that can give a human readable description of itself. """
[docs] def __init__(self, description='UNKNOWN', **kwds): """ Parameters ---------- Returns ------- """ #print(__name__ + str(kwds)) super().__init__(**kwds) # Annotatable # skip if has been set by e.g. Attributable # if not hasattr(self, 'description'): self.description = description
# @property # def description(self): # """ xx must be a property for ``self.xx = yy`` to work in super class after xx is set as a property also by a subclass. # Parameters # ---------- # Returns # ------- # """ # try: # return self._description # except AttributeError: # return None # @description.setter # def description(self, description): # """ Property of the description of this Annotatable object. # Parameters # ---------- # description : string # The new description. # Returns # ------- # """ # self._description = description
[docs] def getDescription(self): """ gets the description of this Annotatable object. Parameters ---------- Returns ------- string: The current description. """ return self.description
[docs] def setDescription(self, newDescription): """ sets the description of this Annotatable object. Parameters ---------- newDescription : string The new description. Returns ------- """ self.description = newDescription