You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks like a good idea for new-comers. If you want to work on this, you'd need to update Tests/run_tests.py to add one of the problem modules like Bio.SubsMat to the DOCTEST_MODULES list (update: Nowadays instead remove it from the EXCLUDE_DOCTEST_MODULES list) - and then:
python3 setup.py install
cd Tests
python3 run_tests.py doctest
And then edit Bio/SubsMat/__init__.py to try to fix the doctest, and repeat.
Some of the examples might be intended to work as doctests, but might just need a file path adjusted or a missing import added.
Others would have been written as incomplete illustrative examples, which may not be practical to turn into self contained doctests.
@pcapel one top level folder per pull request is probably best here (e.g. Bio/PDB/, or Bio/motifs/), in part as they will tend to have different maintainers so that simplifies reviewing changes.
Hello, about fixing the doctest for Bio.motifs.jaspar.db, it seems that the doctest uses an example database host, user, and password. If I'm correctly understanding this, it doesn't seem like this doctest will ever pass since everyone has their database configured differently.
In cases like that, we either exclude the whole file from running doctests (not ideal), or for that example don't write it as a doctest but an RST literal block (i.e. indented code, but no >>> lines).
(Assuming you can't create a temp database as part of the example, with something like SQLite3 that's not a problem - see for examples the Bio.SeqIO.index_db tests).
Sorry, I was wrong, actually they have doctests. I thougth that doctests are only self-running doctests (those modules with if __name__ = "__main__"...run_doctest()).
Hi there! I am new to contributing to open source projects. Please bear with me...
I am working on fixing the Bio.PDB.AbstractPropertyMap doctest. I want to make an AbstractPropertyMap object to fix the test. Trying to figure out where the property_dict, property_keys, property_list can be obtained to make the object.
@kritikadusad I've never used the AbstractPropertyMap class myself, but if you take a took at the ResidueDepth class you can see that it creates a AbstractPropertyMap with the three attributes you need. If you have the test for it running, test_PDB_ResidueDepth.py, you could edit it to try and print the ResidueDepth objects contents maybe?
Hello! I'm looking into BioSQL.BioSeqDatabase and besides the simple import error there is a bigger concern. The existing doctest assumes that user not only has some DB software installed, but:
It has 'root' user
Without a password
This user has access to the existing 'minidb' database
Since we can't guarantee these, my only solution to this could be moving the doctest to the commentary block. Does that seem good?
You can/should make it into a literal block. To do this you end the paragraph before with two colons (::) and remove the >>> from the code block. In this way it is rendered similar to a code block, but it is not run as doctest.
I have done Bio/phenotype/phen_micro and created pr #2235 I have tested it on TravisCI so it required changes to .travis-tox.ini. Since the test passed (except for Python3.8 for which numpy installation fails) I guess I should revert the changes in this file?
# Following modules have historic failures. If you fix one of these
# please remove here!
EXCLUDE_DOCTEST_MODULES = [
"Bio.PDB",
"Bio.PDB.AbstractPropertyMap",
]
I stumbled over biopython/Doc/Tutorial/chapter_testing.tex which also contains EXCLUDE_DOCTEST_MODULES (see below). Does that file need any attention as well?
# Following modules have historic failures. If you fix one of these
# please remove here!
EXCLUDE_DOCTEST_MODULES = [
"Bio.PDB",
"Bio.PDB.AbstractPropertyMap",
"Bio.Phylo.Applications._Fasttree",
"Bio.Phylo._io",
"Bio.Phylo.TreeConstruction",
"Bio.Phylo._utils",
]
Since EXCLUDE_DOCTEST_MODULES is now empty, we could perhaps remove it including the code implementing, and this documentation describing it.
Any comments @mdehoon? As I recall, problematic doctests have either been different versions of Python, or cross platform issues - although in that case the test itself can usually be tweaked (e.g. reduce number of significant figures). e.g. there was a 32 vs 64 bit issue recently.
Activity
peterjc commentedon Jan 21, 2019
Cross reference #1901 to test more doctests in
run_tests.py.peterjc commentedon Jan 21, 2019
This looks like a good idea for new-comers. If you want to work on this, you'd need to update
Tests/run_tests.pyto add one of the problem modules likeBio.SubsMatto theDOCTEST_MODULESlist (update: Nowadays instead remove it from theEXCLUDE_DOCTEST_MODULESlist) - and then:And then edit
Bio/SubsMat/__init__.pyto try to fix the doctest, and repeat.Some of the examples might be intended to work as doctests, but might just need a file path adjusted or a missing import added.
Others would have been written as incomplete illustrative examples, which may not be practical to turn into self contained doctests.
pcapel commentedon Mar 10, 2019
Is it preferred to fix a single module at a time or is it ok to group a few modules together in one merge request?
peterjc commentedon Mar 11, 2019
@pcapel one top level folder per pull request is probably best here (e.g. Bio/PDB/, or Bio/motifs/), in part as they will tend to have different maintainers so that simplifies reviewing changes.
kaskales commentedon Mar 15, 2019
Hello, about fixing the doctest for Bio.motifs.jaspar.db, it seems that the doctest uses an example database host, user, and password. If I'm correctly understanding this, it doesn't seem like this doctest will ever pass since everyone has their database configured differently.
peterjc commentedon Mar 16, 2019
In cases like that, we either exclude the whole file from running doctests (not ideal), or for that example don't write it as a doctest but an RST literal block (i.e. indented code, but no
>>>lines).(Assuming you can't create a temp database as part of the example, with something like SQLite3 that's not a problem - see for examples the
Bio.SeqIO.index_dbtests).Jaspar doctest update - issue #1902 (#1973)
peterjc commentedon Mar 19, 2019
Note that some of the modules on this list are simply missing any doctests at all, e.g.
Bio.Restrictionas noted by @MarkusPiotrowski 4a9dcbc#commitcomment-32819770MarkusPiotrowski commentedon Mar 21, 2019
Sorry, I was wrong, actually they have doctests. I thougth that doctests are only self-running doctests (those modules with
if __name__ = "__main__"...run_doctest()).So, I'm taking care for the
Restrictionmodule.peterjc commentedon Mar 22, 2019
Great - it looks like they need some missing imports added, and blank lines where the expected output otherwise merges into the text - e.g.
https://github.com/biopython/biopython/blob/master/Bio/Restriction/Restriction.py#L286
to:
kritikadusad commentedon Apr 2, 2019
Hi there! I am new to contributing to open source projects. Please bear with me...
I am working on fixing the Bio.PDB.AbstractPropertyMap doctest. I want to make an AbstractPropertyMap object to fix the test. Trying to figure out where the property_dict, property_keys, property_list can be obtained to make the object.
kaskales commentedon Apr 3, 2019
@kritikadusad I've never used the AbstractPropertyMap class myself, but if you take a took at the ResidueDepth class you can see that it creates a AbstractPropertyMap with the three attributes you need. If you have the test for it running, test_PDB_ResidueDepth.py, you could edit it to try and print the ResidueDepth objects contents maybe?
4 remaining items
svalqui commentedon May 1, 2019
I'll work on Bio.SearchIO.ExonerateIO._base
svalqui commentedon May 24, 2019
I'll Work on Bio.Phylo.
fixed doctest for Bio.TogoWS (#2039)
svalqui commentedon Jun 12, 2019
I'll work on Bio.phenotype
svalqui commentedon Jun 26, 2019
I'll work on Bio.PDB.
Andrey-Raspopov commentedon Jul 8, 2019
Hello! I'm looking into BioSQL.BioSeqDatabase and besides the simple import error there is a bigger concern. The existing doctest assumes that user not only has some DB software installed, but:
Since we can't guarantee these, my only solution to this could be moving the doctest to the commentary block. Does that seem good?
MarkusPiotrowski commentedon Jul 8, 2019
You can/should make it into a literal block. To do this you end the paragraph before with two colons (
::) and remove the>>>from the code block. In this way it is rendered similar to a code block, but it is not run as doctest.dizak commentedon Aug 28, 2019
I have done
Bio/phenotype/phen_microand created pr #2235 I have tested it on TravisCI so it required changes to.travis-tox.ini. Since the test passed (except for Python3.8 for whichnumpyinstallation fails) I guess I should revert the changes in this file?peterjc commentedon Aug 30, 2019
Updated the check boxes, just two left:
https://github.com/biopython/biopython/blob/master/Tests/run_tests.py#L78
farAtGitHub commentedon Jan 1, 2020
I created #2482 trying to fix Bio.PDB.AbstractPropertyMap. Hope it's not too far off.
farAtGitHub commentedon Jan 1, 2020
I stumbled over biopython/Doc/Tutorial/chapter_testing.tex which also contains EXCLUDE_DOCTEST_MODULES (see below). Does that file need any attention as well?
peterjc commentedon Jan 3, 2020
Since
EXCLUDE_DOCTEST_MODULESis now empty, we could perhaps remove it including the code implementing, and this documentation describing it.Any comments @mdehoon? As I recall, problematic doctests have either been different versions of Python, or cross platform issues - although in that case the test itself can usually be tweaked (e.g. reduce number of significant figures). e.g. there was a 32 vs 64 bit issue recently.
mdehoon commentedon Jan 4, 2020
Yes let's remove it
peterjc commentedon Jul 30, 2020
Belatedly closing.
We still use
EXCLUDE_DOCTEST_MODULESfor things like ignoring online doctests in offline mode.