Test culling

Bug #607312 reported by Tiago Antao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
newAge
Fix Committed
Undecided
Unassigned

Bug Description

Test culling

Revision history for this message
Andrés Pérez-Figueroa (andres-perez-figueroa) wrote :

I've tried to test culling with different models,
They all laucned this error:

Traceback (most recent call last):
  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/Report.py", line 18, in callAfterMateOps
    pop.dvars().report.acumStats(pop, param)
  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/Report.py", line 451, in acumStats
    self.genCulled[pi][t][replicate] = mySp[pi]['Culled']
KeyError: 'Culled'
Traceback (most recent call last):
  File "/home/andres/tasks/NewAge/soft/src/NewAge/UI/wxUI.py", line 288, in __simulate
    evolution.evolve(pars.runTime)
  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/Evolution.py", line 58, in evolve
    gen = gens,

Revision history for this message
Tiago Antao (tiagoantao) wrote : Re: [Bug 607312] Re: Test culling

Hombre,

Can you send me the config file?

2010/7/22 Andrés Pérez-Figueroa <email address hidden>:
> I've tried to test culling with different models,
> They all laucned this error:
>
> Traceback (most recent call last):
>  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/Report.py", line 18, in callAfterMateOps
>    pop.dvars().report.acumStats(pop, param)
>  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/Report.py", line 451, in acumStats
>    self.genCulled[pi][t][replicate] = mySp[pi]['Culled']
> KeyError: 'Culled'
> Traceback (most recent call last):
>  File "/home/andres/tasks/NewAge/soft/src/NewAge/UI/wxUI.py", line 288, in __simulate
>    evolution.evolve(pars.runTime)
>  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/Evolution.py", line 58, in evolve
>    gen          = gens,
>
> --
> Test culling
> https://bugs.launchpad.net/bugs/607312
> You received this bug notification because you are a member of newAge,
> which is the registrant for newAge.
>
> Status in newAge: A population genetics workbench to simulate and analise age-structured populations: New
>
> Bug description:
> Test culling
>
>
>

--
"If you want to get laid, go to college.  If you want an education, go
to the library." - Frank Zappa

Revision history for this message
Andrés Pérez-Figueroa (andres-perez-figueroa) wrote :

Sorry
attached is one config producing the error.

But I've tried several models more and no one worked if culling option was set

Revision history for this message
Tiago Antao (tiagoantao) wrote :

I think I've solved this one. Can you please test it and see if you
like the results?

2010/7/23 Andrés Pérez-Figueroa <email address hidden>:
> Sorry
> attached is one config producing the error.
>
> But I've tried several models more and no one worked if culling option
> was set
>
> ** Attachment added: "a config for testing culling"
>   http://launchpadlibrarian.net/52362537/config
>
> --
> Test culling
> https://bugs.launchpad.net/bugs/607312
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
"If you want to get laid, go to college.  If you want an education, go
to the library." - Frank Zappa

Revision history for this message
Andrés Pérez-Figueroa (andres-perez-figueroa) wrote :

You've solved for that config. But that config is for a stable population.
When tried the attached it crashes whe culling should be performed.

Traceback (most recent call last):
  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/PopControl.py", line 8, in callPostOps
    pop.dvars().control.culling(pop)
  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/PopControl.py", line 68, in culling
    if len(myRremove) > (total-self.pars.cullObjective):
NameError: global name 'myRremove' is not defined
Traceback (most recent call last):
  File "/home/andres/tasks/NewAge/soft/src/NewAge/UI/wxUI.py", line 290, in __simulate
    evolution.evolve(pars.runTime)
  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/Evolution.py", line 58, in evolve
    gen = gens,
ValueError: Function call failed.

Revision history for this message
Tiago Antao (tiagoantao) wrote :

I think you did not saved the file after simulation (I think I have to
force save automatically, I am always doing this mistake), so this is
an interval culling without interval time specified (thus crashes). I
suppose you were testing something else (either an interval culling
with an interval specified or another type of culling)?

2010/7/23 Andrés Pérez-Figueroa <email address hidden>:
> You've solved for that config. But that config is for a stable population.
> When tried the attached it crashes whe culling should be performed.
>
> Traceback (most recent call last):
>  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/PopControl.py", line 8, in callPostOps
>    pop.dvars().control.culling(pop)
>  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/PopControl.py", line 68, in culling
>    if len(myRremove) > (total-self.pars.cullObjective):
> NameError: global name 'myRremove' is not defined
> Traceback (most recent call last):
>  File "/home/andres/tasks/NewAge/soft/src/NewAge/UI/wxUI.py", line 290, in __simulate
>    evolution.evolve(pars.runTime)
>  File "/home/andres/tasks/NewAge/soft/src/NewAge/Sim/Evolution.py", line 58, in evolve
>    gen          = gens,
> ValueError: Function call failed.
>
>
> ** Attachment added: "config"
>   http://launchpadlibrarian.net/52369772/config
>
> --
> Test culling
> https://bugs.launchpad.net/bugs/607312
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
"If you want to get laid, go to college.  If you want an education, go
to the library." - Frank Zappa

Revision history for this message
Andrés Pérez-Figueroa (andres-perez-figueroa) wrote :

Finally, I want to focus on all these tests.

In PopControl.py line 69 it should be random.suffle(myRemove)

Then in line 84 it throws an exception that global name 'popDead' is not defined.Could be here a confusion between popDead and deadPop?

Revision history for this message
Andrés Pérez-Figueroa (andres-perez-figueroa) wrote :

I forget to say, that using Threshold culling (see attached)

Revision history for this message
Tiago Antao (tiagoantao) wrote :

Your test scenario seems to be working with the new patch (at least it does not crash and produces all output)

Tiago Antao (tiagoantao)
Changed in newage:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.