def getDerMatrix(self,x=None,z=None,mode=None,der=None):
        self.checkInputGetDerMatrix(x,z,mode,der)
        if not x is None:
            assert x.shape[1]==1, 'periodic covariance can only be used for 1d data'
        if not z is None:
            assert z.shape[1]==1, 'periodic covariance can only be used for 1d data'
        ell = np.exp(self.hyp[0])        # characteristic length scale
        p   = np.exp(self.hyp[1])        # period
        sf2 = np.exp(2.*self.hyp[2])     # signal variance
        if mode == 'self_test':           # self covariances for the test cases
            nn,D = z.shape
            A = np.zeros((nn,1))
        elif mode == 'train':             # compute covariance matix for dataset x
            A = np.sqrt(spdist.cdist(x, x, 'sqeuclidean'))
        elif mode == 'cross':             # compute covariance between data sets x and z
            A = np.sqrt(spdist.cdist(x, z, 'sqeuclidean'))
        A = np.pi*A/p
        if der == 0:            # compute derivative matrix wrt 1st parameter
            A = old_div(np.sin(A),ell)
            A = A * A
            A = 4. *sf2 *np.exp(-2.*A) * A
        elif der == 1:          # compute derivative matrix wrt 2nd parameter
            R = old_div(np.sin(A),ell)
            A = 4 * ell * np.exp(-2.*R*R)*R*np.cos(A)*A/sf2
        elif der == 2:          # compute derivative matrix wrt 3rd parameter
            A = old_div(np.sin(A),ell)
            A = A * A
            A = 2. * sf2 * np.exp(-2.*A)
        else:
            raise Exception("Wrong derivative index in covPeriodic")
        return A
dataset/ETHPy150Open marionmari/pyGPs/pyGPs/Core/cov.py/Periodic.getDerMatrix/swapped operands of `/`