def compute_dr_wrt(self, wrt):
        comps = np.zeros(9)
        comps[:len(self.components.r)] = self.components.r
        comps = comps * self.K.ravel()
        if wrt is self.vn:
            vn = self.vn.r.reshape((-1,3))

            #real_coeff[:,1] = (np.sqrt(3)/d_sqrt_pi)*xyz_samples[:,0]
            VS0 = np.ones(self.sh_coeffs.shape[0]) * comps[1]
            #real_coeff[:,2] = (np.sqrt(3)/d_sqrt_pi)*xyz_samples[:,2]
            VS1 = np.ones(self.sh_coeffs.shape[0]) * comps[3]
            #real_coeff[:,3] = (np.sqrt(3)/d_sqrt_pi)*xyz_samples[:,1]
            VS2 = np.ones(self.sh_coeffs.shape[0]) * comps[2]

            #real_coeff[:,4] = (np.sqrt(15)/d_sqrt_pi)*xyz_samples[:,0]*xyz_samples[:,1]
            VS0 += vn[:,1] * comps[4]
            VS1 += vn[:,0] * comps[4]
            
            #real_coeff[:,5] = (np.sqrt(15)/d_sqrt_pi)*xyz_samples[:,1]*xyz_samples[:,2]
            VS1 += vn[:,2]*comps[5]
            VS2 += vn[:,1]*comps[5]
            
            #real_coeff[:,6] = (np.sqrt(5)/2*d_sqrt_pi)*(3*xyz_samples[:,2]**2-1)
            VS2 += 6*vn[:,2] * comps[6]
            
            #real_coeff[:,7] = (np.sqrt(15)/d_sqrt_pi)*xyz_samples[:,0]*xyz_samples[:,2]
            VS0 += vn[:,2] * comps[7]
            VS2 += vn[:,0] * comps[7]

            #real_coeff[:,8] = (np.sqrt(15)/(2*d_sqrt_pi))*(xyz_samples[:,0]**2 - xyz_samples[:,1]**2)
            VS0 += 2. * vn[:,0] * comps[8]
            VS1 -= 2. * vn[:,1] * comps[8]
            
            rng = np.arange(self.sh_coeffs.shape[0])
            IS = np.concatenate((rng, rng, rng))
            JS = np.concatenate((rng*3, rng*3+1, rng*3+2))
            data = np.concatenate((VS0, VS1, VS2))
            result = self.mtx.dot(sp.csc_matrix((data, (IS, JS))))
            
        elif wrt is self.components:
            comps = self.components.r
            n = len(comps)            
            result = self.mtx.dot(self.sh_coeffs[:,:n])
        else:
            return None
            
        which = np.nonzero(0 > self.r.ravel())[0]
        data = np.ones_like(which)
        gr_equal_zero = sp.csc_matrix((data, (which, which)), shape=(self.r.size, self.r.size))

        return gr_equal_zero.dot(result)
dataset/ETHPy150Open mattloper/opendr/lighting.py/SphericalHarmonics.compute_dr_wrt/swapped operands of `>`