def _getModelProjProperty(self):
        prop = self
        def fget(self):
            mapping = getattr(self, '%sMap'%prop.name)
            if mapping is None:
                return None
            inds = getattr(self.propMap, '%sIndex'%prop.name)
            if type(inds) is slice:
                inds = range(*inds.indices(self.nP))
            nI, nP = len(inds),self.nP
            return sp.csr_matrix((np.ones(nI), (range(nI), inds) ), shape=(nI, nP))
        return property(fget=fget)
dataset/ETHPy150Open simpeg/simpeg/SimPEG/PropMaps.py/Property._getModelProjProperty/original