def _getProperty(self):
        prop = self
        def fget(self):
            mapping = getattr(self, '%sMap'%prop.name)
            if mapping is None and prop.propertyLink is None:
                return prop.defaultVal

            if mapping is None and prop.propertyLink is not None:
                linkName, linkMapClass = prop.propertyLink
                linkMap = linkMapClass(None)
                if getattr(self, '%sMap'%linkName, None) is None:
                    return prop.defaultVal
                m = getattr(self, '%s'%linkName)
                return linkMap * m

            m = getattr(self, '%sModel'%prop.name)
            return mapping * m
        return property(fget=fget)
dataset/ETHPy150Open simpeg/simpeg/SimPEG/PropMaps.py/Property._getProperty/original