def METHOD_NAME(self):
    # test the torsion objective as that covers all derivatives (up to
    # third) of a curve
    sigma = 1
    length_scale = 0.5
    points = np.linspace(0, 1, 200, endpoint=False)
    sampler = GaussianSampler(points, sigma, length_scale, n_derivs=3)
    rg = np.random.Generator(PCG64(1))
    sample = PerturbationSample(sampler, randomgen=rg)
    order = 4
    nquadpoints = 200
    curve = CurveXYZFourier(nquadpoints, order)
    dofs = np.zeros((curve.dof_size, ))
    dofs[1] = 1.
    dofs[2*order+3] = 1.
    dofs[4*order+3] = 1.
    curve.x = dofs
    curve = CurvePerturbed(curve, sample)
    J = LpCurveTorsion(curve, p=2)
    J0 = J.J()
    curve_dofs = curve.x
    h = 1e-3 * np.random.rand(len(curve_dofs)).reshape(curve_dofs.shape)
    dJ = J.dJ()
    deriv = np.sum(dJ * h)
    assert np.abs(deriv) > 1e-10
    err = 1e6
    for i in range(10, 20):
        eps = 0.5**i
        curve.x = curve_dofs + eps * h
        Jh = J.J()
        deriv_est = (Jh-J0)/eps
        err_new = np.linalg.norm(deriv_est-deriv)
        print("err_new %s" % (err_new))
        assert err_new < 0.55 * err
        err = err_new