Skip to content

Fixed a table parsing bug. - #583

Merged
peterjc merged 3 commits into
biopython:masterfrom
StuntsPT:master
Mar 3, 2017
Merged

peterjc merged 3 commits into
biopython:masterfrom
StuntsPT:master

Conversation

@StuntsPT

Copy link
Copy Markdown
Contributor

Fixes #582 .

@StuntsPT

Copy link
Copy Markdown
Contributor Author

@peterjc @tiagoantao
So... It's been a while. Ping, just in case it was forgotten. =-)

@peterjc

peterjc commented Aug 29, 2016

Copy link
Copy Markdown
Member

@tiagoantao can you look at this small pull request? Even if you only have time to review it, I can do the merge.

@peterjc

peterjc commented Nov 24, 2016

Copy link
Copy Markdown
Member

@tiagoantao does this little change make sense? Are you happy for it to be accepted as is, or does it need a test?

@peterjc

peterjc commented Jan 26, 2017

Copy link
Copy Markdown
Member

Sorry to nag @tiagoantao, but is it OK to merge this small PR?

And if so, @StuntsPT:

Are you happy to dual licence your contributions under both the Biopython License Agreement AND the BSD 3-Clause License? See #898.

And are you happy to be thanked by name in the NEWS and CONTRIB files?

@StuntsPT

Copy link
Copy Markdown
Contributor Author

@peterjc
Yes, I am OK with dual licensing. Should I also comment on #898 ?
And yes, I'm also happy to have my name on NEWS and CONTRIB files. But are you sure such a small patch warrants this?

@peterjc

peterjc commented Jan 26, 2017

Copy link
Copy Markdown
Member

That's great - I'll update #898 when we merge this.

Regarding acknowledgement, this is a small but real change - but if you prefer we can leave your name off until one day you make a larger contribution. If you need a suggestion, how about adding that wiki example test case to the Biopython unit tests? ;)

@StuntsPT

Copy link
Copy Markdown
Contributor Author

@peterjc Deal!
Also, NCBI should have a 'real' solution for #926 soon.
Adding those 2 contributions will make me feel worthy of being acknowledged.

@peterjc

peterjc commented Mar 3, 2017

Copy link
Copy Markdown
Member

@tiagoantao If you don't object I propose to merge this before the next release.

@StuntsPT if you could add something to the unit tests to confirm this fix, that would be even better.

@StuntsPT

StuntsPT commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

@peterjc I'll be on that today, it was already too late yesterday to implement unit testing. =-)

@codecov-io

codecov-io commented Mar 3, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #583 into master will not change coverage.
The diff coverage is 0%.

@@           Coverage Diff           @@
##           master     #583   +/-   ##
=======================================
  Coverage   80.75%   80.75%           
=======================================
  Files         322      322           
  Lines       49424    49424           
=======================================
  Hits        39913    39913           
  Misses       9511     9511
Impacted Files Coverage Δ
Bio/PopGen/GenePop/Controller.py 10.42% <0%> (ø) ✅

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48d6d31...58309da. Read the comment docs.

@StuntsPT

StuntsPT commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

I seem to be having some problem, since all the PopGen tests are failing here... Is this expected?
Here is an example:

python Tests/test_PopGen_GenePop.py

test_allele_genotype_frequencies (__main__.AppTest)
Test genepop execution on basic allele and genotype frequencies. ... ERROR
test_calc_diversities_fis_with_identity (__main__.AppTest)
Test calculations of diversities ... ... ERROR
test_estimate_nm (__main__.AppTest)
Test Nm estimation. ... ERROR
test_fst_all (__main__.AppTest)
Test genepop execution on all fst. ... ERROR
test_haploidy (__main__.AppTest)
Test haploidy. ... ERROR

======================================================================
ERROR: test_allele_genotype_frequencies (__main__.AppTest)
Test genepop execution on basic allele and genotype frequencies.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Tests/test_PopGen_GenePop.py", line 38, in test_allele_genotype_frequencies
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 553, in calc_allele_genotype_freqs
    self._run_genepop(["INF"], [5, 1], fname)
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
    self.controller()  # checks error level is zero
  File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
    stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=5.1 Mode=Batch InputFile=/home/francisco/Programming/github/biopython/PopGen/big.gen', message 'Unable to open file genepop.txt'

======================================================================
ERROR: test_calc_diversities_fis_with_identity (__main__.AppTest)
Test calculations of diversities ...
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Tests/test_PopGen_GenePop.py", line 56, in test_calc_diversities_fis_with_identity
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 703, in calc_diversities_fis_with_identity
    return self._calc_diversities_fis(fname, ".DIV")
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 669, in _calc_diversities_fis
    self._run_genepop([ext], [5, 2], fname)
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
    self.controller()  # checks error level is zero
  File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
    stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=5.2 Mode=Batch InputFile=/tmp/tmp1giye7ew/PopGen/big.gen', message 'Unable to open file genepop.txt'

======================================================================
ERROR: test_estimate_nm (__main__.AppTest)
Test Nm estimation.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Tests/test_PopGen_GenePop.py", line 68, in test_estimate_nm
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 491, in estimate_nm
    self._run_genepop(["PRI"], [4], fname)
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
    self.controller()  # checks error level is zero
  File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
    stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=4 Mode=Batch InputFile=/tmp/tmpxbyrw49n/PopGen/big.gen', message 'Unable to open file genepop.txt'

======================================================================
ERROR: test_fst_all (__main__.AppTest)
Test genepop execution on all fst.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Tests/test_PopGen_GenePop.py", line 76, in test_fst_all
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 727, in calc_fst_all
    self._run_genepop([".FST"], [6, 1], fname)
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
    self.controller()  # checks error level is zero
  File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
    stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=6.1 Mode=Batch InputFile=/tmp/tmpb1ohvfhn/PopGen/c2line.gen', message 'Unable to open file genepop.txt'

======================================================================
ERROR: test_haploidy (__main__.AppTest)
Test haploidy.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "Tests/test_PopGen_GenePop.py", line 86, in test_haploidy
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 727, in calc_fst_all
    self._run_genepop([".FST"], [6, 1], fname)
  File "/usr/lib/python3.6/site-packages/Bio/PopGen/GenePop/Controller.py", line 246, in _run_genepop
    self.controller()  # checks error level is zero
  File "/usr/lib/python3.6/site-packages/Bio/Application/__init__.py", line 516, in __call__
    stdout_str, stderr_str)
Bio.Application.ApplicationError: Non-zero return code 255 from 'Genepop MenuOptions=6.1 Mode=Batch InputFile=/tmp/tmp6zrluam9/PopGen/haplo.gen', message 'Unable to open file genepop.txt'

----------------------------------------------------------------------
Ran 5 tests in 0.026s

FAILED (errors=5) 

@peterjc

peterjc commented Mar 3, 2017

Copy link
Copy Markdown
Member

Could be you're not in the Tests/ directory which is assumed/expected, and could break all the paths in the command line tests?

@StuntsPT

StuntsPT commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

Yup, that's it. I really have to read the docs on unittest again...

@peterjc

peterjc commented Mar 3, 2017

Copy link
Copy Markdown
Member

In this case its a quirk of the Biopython test, which we've tried to document with a chapter in the Tutorial.

@StuntsPT

StuntsPT commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

Oh. In that case, that's where I'm headed. Thanks!

@StuntsPT

StuntsPT commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

Unit test implemented.
Works on both python3 (3.6 tested) and python2 (2.7 tested).

@peterjc

peterjc commented Mar 3, 2017

Copy link
Copy Markdown
Member

Lovely. It won't trigger under TravisCI as we don't have the command line tool dependencies installed there. Thank you 👍

@peterjc
peterjc merged commit a4f0fa6 into biopython:master Mar 3, 2017
@StuntsPT

StuntsPT commented Mar 3, 2017

Copy link
Copy Markdown
Contributor Author

You''re welcome.
Really glad I could help this project! And also thank you for all the guidance.

MarkusPiotrowski pushed a commit to MarkusPiotrowski/biopython that referenced this pull request Oct 31, 2017
Squashed commit of pull request biopython#583, closes biopython#582.

* Fixed a table parsing bug.

* Added a HWE test so that it won't happen again.
peterjc added a commit to peterjc/biopython that referenced this pull request Jul 30, 2020
peterjc added a commit to peterjc/biopython that referenced this pull request Jul 30, 2020
peterjc added a commit that referenced this pull request Aug 23, 2020
Original author Jeffrey Chang, named copyright holders,
and other contributors tracked with version control have
all agreed:

 - Andrew Dalke (@adalke)
   http://mailman.open-bio.org/pipermail/biopython-dev/2013-August/019941.html
 - Austin Varela (@austinv11)
   #1697
 - Carlos Pena (@carlosp420)
   #898 (comment)
 - chrismit (@Chris7)
   #898 (comment)
 - Christian Brueffer (@cbrueffer)
   #898 (comment)
 - Connor T. Skennerton (@ctSkennerton)
   #898 (comment)
 - Edward Liaw (@edliaw)
   #898 (comment)
 - Eric Rasche (@erasche)
   #898 (comment)
 - Francesco Gastaldello (@Gasta88)
   #1063
 - Francisco Pina-Martins (@StuntsPT)
   #583 (comment)
 - Jacek Śmietański (@dadoskawina)
   #898 (comment)
 - jchang (@jefftc)
   #898 (comment)
 - João D Ferreira (@jdferreira)
   #898 (comment)
 - Mark Amery (@ExplodingCabbage)
   #2165
 - Markus Piotrowski (@MarkusPiotrowski)
   #898 (comment)
 - Michiel de Hoon (@mdehoon)
   #898 (comment)
 - Peter Cock (@peterjc)
   #898 (comment)
 - Sergei Lebedev (@superbobry)
   #898 (comment)
 - Sergio Valqui (@svalqui)
   #1749
 - Sujan Dulal (@Dsujan)
   #2430
 - Travis Wrightsman (@twrightsman)
   #898 (comment)
 - Yi Hsiao (@hsiaoyi0504)
   #1869
peterjc added a commit to peterjc/biopython that referenced this pull request Nov 14, 2020
Original author Tiago Antao and other contributors
since as tracked with version control have agreed:

 - Carlos Pena (@carlosp420)
   biopython#898 (comment)
 - Chris Rands (@chris-rands)
   biopython#1301
 - Christian Brueffer (@cbrueffer)
   biopython#898 (comment)
 - Connor McCoy (@cmccoy)
   biopython#898 (comment)
 - Francesco Gastaldello (@Gasta88)
   biopython#1063
 - Francisco Pina-Martins (@StuntsPT)
   biopython#583 (comment)
 - Jeremy LaBarge (@biojerm)
   biopython#1847 (comment)
 - Lenna Peterson (@lennax)
   biopython#898 (comment)
 - Michiel de Hoon (@mdehoon)
   biopython#898 (comment)
 - @morrme
   biopython#1172 (comment)
 - Nick Negretti (@nimne)
   biopython#1768 (comment)
 - Nick Semenkovich (@semenko)
   biopython#898 (comment)
 - Peter Cock (@peterjc)
   biopython#898 (comment)
 - Sergio Valqui (@svalqui)
   biopython#1749
 - Suresh Panneerselvam (@Amrithasuresh)
   biopython#1575
 - Tiago Antao (@tiagoantao)
   biopython#898 (comment)
 - Travis Wrightsman (@twrightsman)
   biopython#898 (comment)
peterjc added a commit that referenced this pull request Jun 5, 2021
Original author Tiago Antao and other contributors
since as tracked with version control have agreed:

 - Carlos Pena (@carlosp420)
   #898 (comment)
 - Chris Rands (@chris-rands)
   #1301
 - Christian Brueffer (@cbrueffer)
   #898 (comment)
 - Connor McCoy (@cmccoy)
   #898 (comment)
 - Francesco Gastaldello (@Gasta88)
   #1063
 - Francisco Pina-Martins (@StuntsPT)
   #583 (comment)
 - Jeremy LaBarge (@biojerm)
   #1847 (comment)
 - Lenna Peterson (@lennax)
   #898 (comment)
 - Michiel de Hoon (@mdehoon)
   #898 (comment)
 - @morrme
   #1172 (comment)
 - Nick Negretti (@nimne)
   #1768 (comment)
 - Nick Semenkovich (@semenko)
   #898 (comment)
 - Peter Cock (@peterjc)
   #898 (comment)
 - Sergio Valqui (@svalqui)
   #1749
 - Suresh Panneerselvam (@Amrithasuresh)
   #1575
 - Tiago Antao (@tiagoantao)
   #898 (comment)
 - Travis Wrightsman (@twrightsman)
   #898 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants