[Biopython-dev] [Bug 2651] Error from test_GAQueens.py

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon Nov 17 18:59:26 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2651





------- Comment #4 from biopython-bugzilla at maubp.freeserve.co.uk  2008-11-17 13:59 EST -------
This is a quick hack to help pin-point the problem, assuming you have the CVS
or recent version of Biopython installed, modify the end of test_GAQueens.py as
follows:


if __name__ == "__main__":
    #sys.exit(main(sys.argv))
    count = 0
    while True :
        count +=1
        print "#"*50, count
        run_tests([])


This just repeats the test until it fails:

$ python test_GAQueens.py
...
################################################## 7
Calculating for 5 queens...
Generating an initial population of 1000 organisms...
Evolving the population and searching for a solution...
Traceback (most recent call last):
  File "test_GAQueens.py", line 405, in <module>
    run_tests([])
  File "test_GAQueens.py", line 42, in run_tests
    main(arguments)
  File "test_GAQueens.py", line 76, in main
    evolved_pop = evolver.evolve(queens_solved)
  File
"/Users/xxx/Downloads/Software/biopython-1.49b/build/lib.macosx-10.3-i386-2.5/Bio/GA/Evolver.py",
line 56, in evolve
    self._population = self._selector.select(self._population)
  File
"/Users/xxx/Downloads/Software/biopython-1.49b/build/lib.macosx-10.3-i386-2.5/Bio/GA/Selection/Tournament.py",
line 77, in select
    new_orgs[1])
  File
"/Users/xxx/Downloads/Software/biopython-1.49b/build/lib.macosx-10.3-i386-2.5/Bio/GA/Selection/Abstract.py",
line 53, in mutate_and_crossover
    final_org_1 = self._repairer.repair(final_org_1)
  File "test_GAQueens.py", line 234, in repair
    duplicated_items = self._get_duplicates(organism.genome)
  File "test_GAQueens.py", line 203, in _get_duplicates
    if genome.count(item) > 1:
  File
"/Users/xxx/repositories/biopython/build/lib.macosx-10.3-i386-2.5/Bio/Seq.py",
line 886, in count
    raise TypeError("expected a string, Seq or MutableSeq")
TypeError: expected a string, Seq or MutableSeq

i.e. The same traceback as in Bruce's original report (allowing for the update
to the Seq object's count method), but easier to reproduce.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list