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

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

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