@@ -0,0 +1,1371 @@
+#Copyright 2013 Thomas A Caswell%0A#tcaswell@uchicago.edu%0A#http://jfi.uchicago.edu/~tcaswell%0A#%0A#This program is free software; you can redistribute it and/or modify%0A#it under the terms of the GNU General Public License as published by%0A#the Free Software Foundation; either version 3 of the License, or (at%0A#your option) any later version.%0A#%0A#This program is distributed in the hope that it will be useful, but%0A#WITHOUT ANY WARRANTY; without even the implied warranty of%0A#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU%0A#General Public License for more details.%0A#%0A#You should have received a copy of the GNU General Public License%0A#along with this program; if not, see %3Chttp://www.gnu.org/licenses%3E.%0Aimport trackpy.tracking as pt%0Aimport numpy as np%0A%0A%0Adef test_easy_tracking():%0A    level_count = 5%0A    p_count = 16%0A    levels = %5B%5D%0A%0A    for j in range(level_count):%0A        level = %5B%5D%0A        for k in np.arange(p_count) * 2:%0A            level.append(pt.PointND(j, (j, k)))%0A        levels.append(level)%0A%0A    hash_generator = lambda: pt.Hash_table((level_count + 1, p_count * 2 + 1), .5)%0A    tracks = pt.link(levels, 1.5, hash_generator)%0A%0A    assert len(tracks) == p_count%0A%0A    for t in tracks:%0A        x, y = zip(*%5Bp.pos for p in t%5D)%0A        dx = np.diff(x)%0A        dy = np.diff(y)%0A%0A        assert np.sum(dx) == level_count - 1%0A        assert np.sum(dy) == 0%0A

set up basic testing using nose