Skip to content

no flake8 doctests checking in Bio/ #1899

Closed

Description

@rwst

(master with Py3)
flake8 is not finding doctest code problems under Bio/ because Bio/.flake8 does not have the line doctests = True as in Scripts/.flake8 and Tests/.flake8 (it's commented out). This leads to the following problems not being reported:

Bio/Seq.py:193:13: F811 redefinition of unused 'generic_dna' from line 182
Bio/phenotype/phen_micro.py:244:19: F821 undefined name 'align'
Bio/phenotype/phen_micro.py:570:24: F821 undefined name 'well1'
Bio/Restriction/Restriction.py:286:13: F821 undefined name 'EcoRI'
Bio/Restriction/Restriction.py:295:27: F821 undefined name 'EcoRI'
Bio/Restriction/Restriction.py:318:13: F821 undefined name 'EcoRI'
Bio/Restriction/Restriction.py:327:28: F821 undefined name 'EcoRI'
Bio/Restriction/Restriction.py:377:13: F821 undefined name 'SacI'
Bio/Restriction/Restriction.py:377:21: F821 undefined name 'SstI'
Bio/Restriction/Restriction.py:379:13: F821 undefined name 'SacI'
Bio/Restriction/Restriction.py:379:21: F821 undefined name 'SstI'
Bio/Restriction/Restriction.py:394:13: F821 undefined name 'SmaI'
Bio/Restriction/Restriction.py:394:21: F821 undefined name 'XmaI'
Bio/Restriction/Restriction.py:408:13: F821 undefined name 'XhoI'
Bio/Restriction/Restriction.py:408:20: F821 undefined name 'SalI'
Bio/Restriction/Restriction.py:422:13: F821 undefined name 'EcoRI'
Bio/Restriction/Restriction.py:424:13: F821 undefined name 'EcoRV'
Bio/Restriction/Restriction.py:426:13: F821 undefined name 'EcoRI'
Bio/Restriction/Restriction.py:426:22: F821 undefined name 'EcoRV'
Bio/Restriction/Restriction.py:541:13: F821 undefined name 'SacI'
Bio/Restriction/Restriction.py:541:35: F821 undefined name 'SstI'
Bio/Restriction/Restriction.py:543:13: F821 undefined name 'SmaI'
Bio/Restriction/Restriction.py:543:35: F821 undefined name 'XmaI'
Bio/Restriction/Restriction.py:565:13: F821 undefined name 'SacI'
Bio/Restriction/Restriction.py:565:34: F821 undefined name 'SstI'
Bio/Restriction/Restriction.py:567:13: F821 undefined name 'SmaI'
Bio/Restriction/Restriction.py:567:34: F821 undefined name 'XmaI'
Bio/Restriction/Restriction.py:1566:13: F821 undefined name 'EcoRI'
Bio/Restriction/Restriction.py:1568:13: F821 undefined name 'KpnI'
Bio/Restriction/Restriction.py:1570:13: F821 undefined name 'EcoRV'
Bio/Restriction/Restriction.py:1572:13: F821 undefined name 'SnaI'
Bio/Restriction/Restriction.py:1739:13: F821 undefined name 'EcoRI'
Bio/Restriction/Restriction.py:1741:13: F821 undefined name 'KpnI'
Bio/Restriction/Restriction.py:1743:13: F821 undefined name 'EcoRV'
Bio/Restriction/Restriction.py:1745:13: F821 undefined name 'SnaI'
Bio/Restriction/Restriction.py:1906:13: F821 undefined name 'EcoRI'
Bio/Restriction/Restriction.py:1908:13: F821 undefined name 'KpnI'
Bio/Restriction/Restriction.py:1910:13: F821 undefined name 'EcoRV'
Bio/Restriction/Restriction.py:1912:13: F821 undefined name 'SnaI'
Bio/Phylo/TreeConstruction.py:375:18: F721 syntax error in doctest
Bio/Phylo/TreeConstruction.py:387:21: F721 syntax error in doctest
Bio/Phylo/TreeConstruction.py:399:21: F721 syntax error in doctest
Bio/Phylo/TreeConstruction.py:550:39: F821 undefined name 'dm'
Bio/Phylo/TreeConstruction.py:551:24: F721 syntax error in doctest
Bio/Phylo/TreeConstruction.py:565:33: F821 undefined name 'dm'
Bio/Phylo/TreeConstruction.py:566:21: F721 syntax error in doctest
Bio/Phylo/TreeConstruction.py:1054:9: F403 'from TreeConstruction import *' used; unable to detect undefined names
Bio/Phylo/TreeConstruction.py:1056:18: F721 syntax error in doctest
Bio/Phylo/TreeConstruction.py:1063:25: F405 'Phylo' may be undefined, or defined from star imports: TreeConstruction
Bio/Phylo/TreeConstruction.py:1064:19: F721 syntax error in doctest
Bio/Phylo/TreeConstruction.py:1074:9: F403 'from TreeConstruction import *' used; unable to detect undefined names
Bio/Phylo/TreeConstruction.py:1079:24: F721 syntax error in doctest
Bio/Phylo/_utils.py:108:21: F821 undefined name 'Phylo'
Bio/Phylo/_utils.py:108:41: F821 undefined name 'tree'
Bio/Phylo/_utils.py:308:9: F821 undefined name 'Phylo'
Bio/Phylo/_utils.py:308:20: F821 undefined name 'tree'
Bio/motifs/minimal.py:23:22: F821 undefined name 'meme'
Bio/Cluster/__init__.py:178:27: F821 undefined name 'array'
Bio/Cluster/__init__.py:183:27: F821 undefined name 'array'
Bio/Cluster/__init__.py:185:28: F821 undefined name 'array'
Bio/Cluster/__init__.py:186:28: F821 undefined name 'array'
Bio/Cluster/__init__.py:187:28: F821 undefined name 'array'
Bio/Cluster/__init__.py:262:27: F821 undefined name 'array'
Bio/Cluster/__init__.py:267:27: F821 undefined name 'array'
Bio/Cluster/__init__.py:269:28: F821 undefined name 'array'
Bio/Cluster/__init__.py:270:28: F821 undefined name 'array'
Bio/Cluster/__init__.py:271:28: F821 undefined name 'array'
Bio/Cluster/__init__.py:526:9: F821 undefined name 'columnmean'
Bio/Cluster/__init__.py:526:22: F821 undefined name 'dot'
Bio/Cluster/__init__.py:526:26: F821 undefined name 'coordinates'
Bio/Cluster/__init__.py:526:39: F821 undefined name 'pc'
Bio/PDB/vectors.py:104:21: F821 undefined name 'pi'
Bio/PDB/vectors.py:105:26: F821 undefined name 'any_vector'
Bio/PDB/vectors.py:140:25: F821 undefined name 'p'
Bio/PDB/vectors.py:140:28: F821 undefined name 'q'
Bio/PDB/vectors.py:141:14: F821 undefined name 'p'
Bio/PDB/vectors.py:142:15: F821 undefined name 'q'
Bio/PDB/vectors.py:173:20: F821 undefined name 'p'
Bio/PDB/vectors.py:173:23: F821 undefined name 'q'
Bio/PDB/vectors.py:174:15: F821 undefined name 'q'
Bio/PDB/vectors.py:175:15: F821 undefined name 'p'
Bio/PDB/AbstractPropertyMap.py:35:17: F821 undefined name 'chain_id'
Bio/PDB/AbstractPropertyMap.py:35:27: F821 undefined name 'res_id'
Bio/PDB/AbstractPropertyMap.py:35:38: F821 undefined name 'apmap'
Bio/PDB/AbstractPropertyMap.py:36:29: F821 undefined name 'apmap'
Bio/PDB/AbstractPropertyMap.py:36:36: F821 undefined name 'chain_id'
Bio/PDB/AbstractPropertyMap.py:36:46: F821 undefined name 'res_id'
Bio/PDB/Entity.py:286:24: F821 undefined name 'rotmat'
Bio/PDB/Entity.py:286:31: F821 undefined name 'pi'
Bio/PDB/Entity.py:286:35: F821 undefined name 'Vector'
Bio/PDB/Entity.py:287:27: F821 undefined name 'array'
Bio/PDB/Entity.py:288:13: F821 undefined name 'entity'
Bio/PDB/PDBIO.py:50:11: F821 undefined name 'PDBParser'
Bio/PDB/mmcifio.py:52:15: F821 undefined name 'MMCIFParser'
Bio/PDB/FragmentMapper.py:161:20: F821 undefined name 'fragment1'
Bio/PDB/FragmentMapper.py:161:32: F821 undefined name 'fragment2'
Bio/PDB/Atom.py:215:24: F821 undefined name 'atom1'
Bio/PDB/Atom.py:215:32: F821 undefined name 'atom2'
Bio/PDB/Atom.py:369:22: F821 undefined name 'rotmat'
Bio/PDB/Atom.py:369:29: F821 undefined name 'pi'
Bio/PDB/Atom.py:370:25: F821 undefined name 'array'
Bio/PDB/Atom.py:371:13: F821 undefined name 'atom'

I'll try to fix these. I have no opinion on if the line should be activated in Bio/.flake8 (and BioSQL/.flake8).

Activity

  1. peterjc commented on Jan 18, 2019

    @peterjc
    Member

    It would be good to activate, but quite a lot of work to fix. By all means have a go, even fixing some of these warnings would be good.

    I think most of the F821 cases will require replacing from XXX import * with from XXX import, u, v, w

  2. rwst commented on Jan 18, 2019

    @rwst
    ContributorAuthor

    Bio.PDB has only a few doctests and handwaving examples. I have saved some doctests but propose to comment out the examples.

  3. peterjc commented on Jan 18, 2019

    @peterjc
    Member

    A couple of specific examples would help - I'm unclear what you mean by comment out in this context - convert to an RST literal block?

  4. rwst commented on Jan 18, 2019

    @rwst
    ContributorAuthor

    No, just put a # after the >>> in the respective lines.

  5. rwst commented on Jan 19, 2019

    @rwst
    ContributorAuthor

    Actually, converting to an RST literal block seems best.

  6. peterjc commented on Jan 21, 2019

    @peterjc
    Member

    Closed via #1900, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions