Closed peterjc closed 4 years ago
I'll work on test_PDB*
I'll work on test_SeqIO*
I'll work on test_SearchIO* files.
I'll work on test_pro* files.
I'll work on test_Phylo* files.
I'll work on test_PAML* files.
I'll work on test_T* files.
I'll skip test_Tutorial.py as is raising errors with some doctest on the tutorial. ValueError: 4 Tutorial doctests failed: test_chapter_entrez_line_00202, test_chapter_entrez_line_00325, test_chapter_entrez_line_00419, test_chapter_entrez_line_00466,
I'll work on SCOP files
You can try python run_tests.py test_Tutoturial.py --offline
but it sounds like four of the online Entrez tests in the Tutorial were failing. Please confirm if that was only after running black or not. If not, please open a new issue. Thanks.
It was before running black, I have logged an issue for that.
I'll work on test_PopGen* files
I'll work on test_phenotype* files.
I'll work on test_NCBI* files.
test_NCBI_qblast.py is failing, before and after black, so not black related, I'll apply black style and then log an issue.
I'll work on test_m* files.
I'll work on test_l* files.
I'll work on test_k* files.
I'll work on test_HMM* files.
I'll work on test_g* files.
I'll work on test_Entrez files.
I'll work on test_Emboss files.
I'll work on test_BioSQL files.
I'll work on test_AlignIO files.
All that could had been grouped had black style applied, now looking at individual files.
Hello, I'm still new to contributing. Unless I'm mistaken, it looks like test_Nexus.py has not been updated yet. I'm a little confused as to what to do though. When I run black and then "flake8 test_Nexus.py" it only shows 4 lines with trailing whitespace, but when I fix that and go to commit, the pre-commit hook complains about all the missing docstrings for public classes and functions. Glancing at some of the other users work, it looks like some of them also have classes with missing docstrings, eg. class TestSwissProt in test_SwissProt.py.
This file also has the issue of black wanting to expand all the number lists to many lines, but I'll worry about that later.
Any guidance is appreciated!
Are you using the .flake8
config file of the master branch? E.g. the errors you mentioned are, afaik, turned off for the test
folder.
I'm not quite sure. When I run flake8 Tests/test_Nexus.py
it does not show errors, but when I go to commit it gives me several errors that the .flake8
file should be ignoring.
The file .flake8 has a section where list some errors that can be ignored:
https://github.com/biopython/biopython/blob/6c75d2da18afdc89b6b3ef994d87c601f856ae27/.flake8#L45-L48
for example if you run flake and get this:
test_Nexus.py:1168:1: D102 Missing docstring in public method
you can ignore it, that relates to missing documentation, a missing docstring in a method not this issue.
if you get this:
test_Nexus.py:727:46: W291 trailing whitespace
then you should fix it, this is not been ignored, most likely a space in the wrong place that makes the code not PEP compliant or looks odd.
This issue relates to the styling of the code only, black makes the code look even, however in this project the results of black styling is not necessary better, for example some list are presented as one item per line making long lists hard to read, that might need adjustment, core members or contributors will advice accordingly.
I hope this helps.
Thanks you for the advice! That makes sense, I couldn't figure out how to force a commit when it gives those errors I mentioned, but I realized I can use the --no-verify
argument when I'm sure those are the only errors. I'll get working on this then.
Probably, your pre-commit hook is set wrongly. Have you tried to remove and re-set it? Are you in the \biopython
folder when doing the commit? I mean, the place from where you type git commit ...
One simple possibility: It could be you had a flake8 error, did the git add, git commit - and got the warning. If you then fixed the flake8 error, and repeated git commit without doing git add first, it would still be trying to commit the bad version, not the newer fixed version. If so, do another git add, then retry the git commit.
Many thanks to @svalqui - just merged a bunch of their pull requests for this issue which had been left pending.
Went through the files, to see which ones need black. 120/210 already done! Feel free to tag me if you make a PR, and I'll edit this to make it up to date.
common_BioSQL.py
common_BioSQL_online.py
gen_results.py
pairwise2_testCases.py
requires_internet.py
requires_wise.py
run_tests.py
search_tests_common.py
seq_tests_common.py
test_Ace.py
test_Affy.py
test_AlignIO.py
test_AlignIO_ClustalIO.py
test_AlignIO_EmbossIO.py
test_AlignIO_FastaIO.py
test_AlignIO_MauveIO.py
test_AlignIO_PhylipIO.py
test_AlignIO_convert.py
test_AlignInfo.py
test_Application.py
test_BWA_tool.py
test_BioSQL_MySQLdb.py
test_BioSQL_MySQLdb_online.py
test_BioSQL_mysql_connector.py
test_BioSQL_mysql_connector_online.py
test_BioSQL_psycopg2.py
test_BioSQL_psycopg2_online.py
test_BioSQL_sqlite3.py
test_BioSQL_sqlite3_online.py
test_Blast_Record.py
test_CAPS.py
test_Chi2.py
test_ClustalOmega_tool.py
test_Clustalw_tool.py
test_Cluster.py
test_CodonTable.py
test_ColorSpiral.py
test_Compass.py
test_Consensus.py
test_Crystal.py
test_DSSP_tool.py
test_Dialign_tool.py
test_EMBL_unittest.py
test_Emboss.py
test_EmbossPhylipNew.py
test_EmbossPrimer.py
test_Entrez.py
test_Entrez_online.py
test_Entrez_parser.py
test_Enzyme.py
test_ExPASy.py
test_FSSP.py
test_Fasttree_tool.py
test_File.py
test_GenBank.py
test_GenomeDiagram.py
test_GraphicsBitmaps.py
test_GraphicsChromosome.py
test_GraphicsDistribution.py
test_GraphicsGeneral.py
test_HMMCasino.py
test_HMMGeneral.py
test_KEGG.py
test_KEGG_online.py
test_KGML_graphics.py
test_KGML_graphics_online.py
test_KGML_nographics.py
test_KeyWList.py
test_LogisticRegression.py
test_MSAProbs_tool.py
test_MafIO_index.py
test_Mafft_tool.py
test_MarkovModel.py
test_Medline.py
test_Muscle_tool.py
test_NACCESS_tool.py
test_NCBITextParser.py
test_NCBIXML.py
test_NCBI_BLAST_tools.py
test_NCBI_qblast.py
test_NMR.py
test_NaiveBayes.py
test_Nexus.py
test_PAML_baseml.py
test_PAML_codeml.py
test_PAML_tools.py
test_PAML_yn00.py
test_PDB.py
test_PDBList.py
test_PDB_Dice.py
test_PDB_FragmentMapper.py
test_PDB_KDTree.py
test_PDB_MMCIF2Dict.py
test_PDB_MMCIFParser.py
test_PDB_Polypetide.py
test_PDB_ResidueDepth.py
test_PDB_StructureAlignment.py
test_PDB_Superimposer.py
test_PDB_parse_pdb_header.py
test_PDB_vectors.py
test_PQR.py
test_Pathway.py
test_Phd.py
test_Phylo.py
test_PhyloXML.py
test_Phylo_CDAO.py
test_Phylo_NeXML.py
test_Phylo_matplotlib.py
test_Phylo_networkx.py
test_PopGen_GenePop.py
test_PopGen_GenePop_EasyController.py
test_PopGen_GenePop_nodepend.py
test_Prank_tool.py
test_Probcons_tool.py
test_ProtParam.py
test_QCPSuperimposer.py
test_RCSBFormats.py
test_Restriction.py
test_SCOP_Astral.py
test_SCOP_Cla.py
test_SCOP_Des.py
test_SCOP_Dom.py
test_SCOP_Hie.py
test_SCOP_Raf.py
test_SCOP_Residues.py
test_SCOP_Scop.py
test_SCOP_online.py
test_SVDSuperimposer.py
test_SearchIO_blast_tab.py
test_SearchIO_blast_tab_index.py
test_SearchIO_blast_text.py
test_SearchIO_blast_xml.py
test_SearchIO_blast_xml_index.py
test_SearchIO_blat_psl.py
test_SearchIO_blat_psl_index.py
test_SearchIO_exonerate.py
test_SearchIO_exonerate_text_index.py
test_SearchIO_exonerate_vulgar_index.py
test_SearchIO_fasta_m10.py
test_SearchIO_fasta_m10_index.py
test_SearchIO_hhsuite2_text.py
test_SearchIO_hmmer2_text.py
test_SearchIO_hmmer2_text_index.py
test_SearchIO_hmmer3_domtab.py
test_SearchIO_hmmer3_domtab_index.py
test_SearchIO_hmmer3_tab.py
test_SearchIO_hmmer3_tab_index.py
test_SearchIO_hmmer3_text.py
test_SearchIO_hmmer3_text_index.py
test_SearchIO_interproscan_xml.py
test_SearchIO_legacy.py
test_SearchIO_model.py
test_SearchIO_write.py
test_SeqFeature.py
test_SeqIO.py
test_SeqIO_AbiIO.py
test_SeqIO_FastaIO.py
test_SeqIO_Gck.py
test_SeqIO_Insdc.py
test_SeqIO_NibIO.py
test_SeqIO_PdbIO.py
test_SeqIO_QualityIO.py
test_SeqIO_SeqXML.py
test_SeqIO_SnapGene.py
test_SeqIO_Xdna.py
test_SeqIO_features.py
test_SeqIO_index.py
test_SeqIO_online.py
test_SeqIO_write.py
test_SeqRecord.py
test_SeqUtils.py
test_Seq_objs.py
test_SffIO.py
test_SubsMat.py
test_SwissProt.py
test_TCoffee_tool.py
test_TogoWS.py
test_TreeConstruction.py
test_Tutorial.py
test_UniGene.py
test_UniProt_GOA.py
test_Uniprot.py
test_Wise.py
test_XXmotif_tool.py
test_align.py
test_align_substitution_matrices.py
test_bgzf.py
test_cellosaurus.py
test_codonalign.py
test_geo.py
test_kNN.py
test_lowess.py
test_mmtf.py
test_mmtf_online.py
test_motifs.py
test_motifs_online.py
test_pairwise2.py
test_pairwise2_no_C.py
test_pairwise_aligner.py
test_phenotype.py
test_phenotype_fit.py
test_phyml_tool.py
test_prodoc.py
test_prosite1.py
test_prosite2.py
test_psw.py
test_raxml_tool.py
test_samtools_tool.py
test_seq.py
test_translate.py
I'll work on test_psw.py
I'll work on test_phyml_tool.py
I'll work on test_pairwise2_no_C.py
I'll work on test_codonalign.py
I'll work on test_cellosaurus.py
I'll work on test_Ace.py
I'll work on test_Cluster.py
I'll work on test_seq.py
I'm new to contributing but I'll try working on these: test_Prank_tool.py
,test_Dialign_tool.py
, test_Affy.py
, test_NACCESS_tool.py
I'll work on test_CodonTable.py
I've added this issue as a suggestion for the BCC2020 CoFest, since it is relatively straightforward to help with.
I'll work on test_SeqIO_Xdna.py
, test_SeqIO_write.py
and test_PDB_MMCIFParser.py
Not an extensive list, but from Tests/test_* I believe these are the ones remaining (checked if someone's already working on them):
I will work on Tests/test_GenBank.py
.
The end is in sight. Some will be tiny changes as the file was previously black formatted but some minor edits were done which didn't quite follow the style (and we missed that because it isn't yet enforced on the Tests/ folder).
This is a spin out from #2008, where we have agreed to adopt the black code formatting tool for Biopython:
https://github.com/psf/black
That issue focused on applying black to the main code base (
Bio/
,BioSQL/
, and alsoScripts/
andDoc/examples/
).This issue is for applying
black
to the Biopython test suite.In principle this is a good issue for new contributors. However, many of the tests include expected data values, so compared to the Biopython main code there are more likely to be cases where black does a bad job - which will need some discussion (e.g. can it be improved with extra brackets, or do we turn off black for a portion of a test file?).
You will need to install black, flake8, and associated plugins as described in https://github.com/biopython/biopython/blob/master/CONTRIBUTING.rst - and we recommend turning on the git pre-commit hook).
Example workflow:
To avoid duplication of effort, please comment here if you are going to work on a particular file, or group of files.