def test_project():

    trajs = Trajectories(data.directed_motion_trajs_df())
    trajs.rename(columns={'true_label': 'new_label'}, inplace=True)
    trajs.relabel()

    trajs.project([0, 1],
                  coords=['x', 'y'],
                  keep_first_time=False,
                  reference=None,
                  inplace=True,
                  progress=False)

    excepted = np.array([[ 0.27027431,  0.        ],
                         [-0.27027431,  0.        ],
                         [-0.25306519,  0.69683713],
                         [ 0.04633664,  0.31722648]])

    assert_array_almost_equal(excepted, trajs.loc[:,['x_proj', 'y_proj']].values[:4])

    trajs = trajs.project([0, 1],
                           coords=['x', 'y'],
                           keep_first_time=False,
                           reference=None,
                           inplace=False,
                           progress=False)

    assert_array_almost_equal(excepted, trajs.loc[:,['x_proj', 'y_proj']].values[:4])

    assert_raises(ValueError, trajs.project, [0, 1], coords=['x', 'y', 'z', 't'])