[Biopython-dev] test_PopGen_GenePop_EasyController.py failure on Jython

Peter Cock p.j.a.cock at googlemail.com
Fri Nov 12 17:55:57 UTC 2010


2010/11/12 Peter Cock <p.j.a.cock at googlemail.com>:
> Hi all,
>
> I've exchanged a few emails with Tiago off list regarding an inconsistent
> test_PopGen_GenePop_EasyController.py problem (most visible on
> Jython), giving error "Unable to open file genepop.txt".
>
> I've just had it from Python 2.7 on a 32bit Linux machine:
>
> ======================================================================
> ERROR: test_get_avg_fst_pair (test_PopGen_GenePop_EasyController.AppTest)
> Test get pairwise Fst.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "/home/pjcock/repositories/biopython/Tests/test_PopGen_GenePop_EasyController.py",
> line 98, in test_get_avg_fst_pair
>    pop_fis =  self.ctrl.get_avg_fst_pair()
>  File "/home/pjcock/repositories/biopython/build/lib.linux-i686-2.7/Bio/PopGen/GenePop/EasyController.py",
> line 162, in get_avg_fst_pair
>    return self._controller.calc_fst_pair(self._fname)[1]
>  File "/home/pjcock/repositories/biopython/build/lib.linux-i686-2.7/Bio/PopGen/GenePop/Controller.py",
> line 819, in calc_fst_pair
>    self._run_genepop([".ST2", ".MIG"], [6,2], fname)
>  File "/home/pjcock/repositories/biopython/build/lib.linux-i686-2.7/Bio/PopGen/GenePop/Controller.py",
> line 296, in _run_genepop
>    % (ret, e_out.strip().split("\n",1)[0]))
> IOError: GenePop error -11, Unable to open file genepop.txt
>
> ======================================================================
> ERROR: test_get_avg_fst_pair_locus (test_PopGen_GenePop_EasyController.AppTest)
> Test get average Fst for pairwise pops on a locus.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "/home/pjcock/repositories/biopython/Tests/test_PopGen_GenePop_EasyController.py",
> line 93, in test_get_avg_fst_pair_locus
>    self.assertEqual(len(self.ctrl.get_avg_fst_pair_locus("Locus4")), 45)
>  File "/home/pjcock/repositories/biopython/build/lib.linux-i686-2.7/Bio/PopGen/GenePop/EasyController.py",
> line 166, in get_avg_fst_pair_locus
>    iter = self._controller.calc_fst_pair(self._fname)[0]
>  File "/home/pjcock/repositories/biopython/build/lib.linux-i686-2.7/Bio/PopGen/GenePop/Controller.py",
> line 819, in calc_fst_pair
>    self._run_genepop([".ST2", ".MIG"], [6,2], fname)
>  File "/home/pjcock/repositories/biopython/build/lib.linux-i686-2.7/Bio/PopGen/GenePop/Controller.py",
> line 296, in _run_genepop
>    % (ret, e_out.strip().split("\n",1)[0]))
> IOError: GenePop error -11, Unable to open file genepop.txt
>
> ----------------------------------------------------------------------
>
>
> This failed twice in a row, then passed four times in a row (Linux, Python 2.7).
> I suspect the issue was related to machine IO load - during the first
> tests I had something compiling at the same time. I can't reproduce
> it on demand :(
>
> I've also seen it on the Mac with Apple's Python 2.6 (although usually it is
> usually fine).
>
> However, I'm seeing this (consistently?) with Jython 2.5.1 on the Mac.

Well right now on my Mac with Jython, the test passes but with lots of warnings:

$ jython test_PopGen_GenePop_EasyController.py
Test basic info. ... ok
Test Nm estimation. ... ok
Test allele frequency. ... ok
Test get alleles. ... ok
Test get alleles for all populations. ... ok
Test average Fis. ... ok
Test get pairwise Fst. ... ok
Test get average Fst for pairwise pops on a locus. ... Exception
OSError: [Errno 0] couldn't delete file: 'big.gen.INF' in <bound
method _FileIterator.__del__ of
<Bio.PopGen.GenePop.Controller._FileIterator instance at 0x1>> ignored
Exception OSError: [Errno 0] couldn't delete file: 'big.gen.IN2' in
<bound method _FileIterator.__del__ of
<Bio.PopGen.GenePop.Controller._FileIterator instance at 0x2>> ignored
ok
Test F stats. ... ok
Test get Fis. ... Exception OSError: [Errno 0] couldn't delete file:
'big.gen.ST2' in <bound method _FileIterator.__del__ of
<Bio.PopGen.GenePop.Controller._FileIterator instance at 0x3>> ignored
ok
Test genotype count. ... ok
Test heterozygosity info. ... Exception OSError: [Errno 0] couldn't
delete file: 'big.gen.INF' in <bound method _FileIterator.__del__ of
<Bio.PopGen.GenePop.Controller._FileIterator instance at 0x4>> ignored
Exception OSError: [Errno 0] couldn't delete file: 'big.gen.IN2' in
<bound method _FileIterator.__del__ of
<Bio.PopGen.GenePop.Controller._FileIterator instance at 0x5>> ignored
ok
Test multilocus F stats. ... ok

----------------------------------------------------------------------
Ran 13 tests in 5.912s

Or another example, the same machine as a build slave:

http://events.open-bio.org:8010/builders/OS%20X%2010.6%20Snow%20Leopard%20-%20Jython%202.5.1/builds/9/steps/shell/logs/stdio

On the previous build Jython on Mac gave the same error I reported
above on Linux with "C" Python 2.7:

http://events.open-bio.org:8010/builders/OS%20X%2010.6%20Snow%20Leopard%20-%20Jython%202.5.1/builds/7/steps/shell/logs/stdio

Peter




More information about the Biopython-dev mailing list