def test_height(): from EvoDAG import RootGP from EvoDAG.node import Mul gp = RootGP(generations=1, seed=1, tournament_size=2, popsize=5) gp.X = X y = cl.copy() mask = y == 0 y[mask] = 1 y[~mask] = -1 gp.y = y gp.create_population() assert np.all([x.height == 0 for x in gp.population.population[:4]]) n = gp.population.population[-1] assert n.height == 1 args = [3, 4] f = gp._random_offspring(Mul, args) assert f.height == 2