Commit Graph

99 Commits

Author SHA1 Message Date
de0bb21fb3 Apply isort (forcing single lines, not sorting by type) via ruff
$ ruff check --fix --select=I \
  --config=lint.isort.force-single-line=true \
  --config=lint.isort.order-by-type=false \
  BioSQL/ Bio/ Tests/ Scripts/ Doc/ setup.py

Using ruff version 0.4.10
2024-06-26 15:31:39 +09:00
a47460e59a Misc spellings flagged by codespell (#4716)
Note the childs to children changes in Bio/Phylo/Consensus.py
included fixing internal variable names only.

Not applying all the catergories ==> categories fixes
to the (deprecated) EMBOSS wrappers as some would be
functional changes.

Also no more LaTeX files (for spell checking)
2024-05-01 14:21:12 +01:00
57056bbfc4 ruff format v0.3.1, black v24.2.0
Reverted unwanted changes (mostly arrays in tests, but also
some whitespace in doctests).

Remaining changes are standardising spacing between module
docstring and imports, and lower-case \x<hex> in strings.
2024-03-14 11:05:43 +00:00
15cd2809e9 minor_fix (#4011) 2022-07-31 01:20:05 +09:00
e91ebf69cb More spelling fixes with codespell
$ codespell -L som,ser,hsa,fpr,hist,ba,vie,mot,otu,dum,aks,conect,acount,compsite,dealign,nd,noe,minum,ot,lod,childs,ans,arry Bio --skip "Bio/Data/SCOPData.py,Bio/Restriction/*,Bio/Entrez/DTDs/*,Bio/Data/IUPACData.py,Bio/Phylo/_cdao_owl.py" -w
2021-08-31 10:41:38 +01:00
89dca6d303 Fixing assorted ambiguous typos 2021-08-31 10:41:38 +01:00
beb3138162 Declare Bio.Application obsolete
See discussion on #2877.
2021-01-25 09:53:30 +00:00
4241729c8b Fix triple-quote indentation; remove EMBOSS 6.1.0 refs
EMBOSS 6.1.0 was released over ten years ago
(15th July 2009), so there is little reason
to preserve the long obsolete command line
argument variants.

Also, this similified fixing the triple-quoted
string indentation - see #2369.
2020-01-07 12:03:59 +00:00
f215a69911 Post-black string concatenation fix 2020-01-07 12:03:59 +00:00
1e8379f66e black, version 19.03b, on Bio.Emboss 2020-01-07 12:03:59 +00:00
0c25556525 Removed print_function and division future imports 2019-12-25 14:41:32 +00:00
8677e94d3d Double backticks for RST markup
Avoid using single backticks (other than RST links).
2019-07-16 16:56:39 +01:00
2a0e932de9 Dual license Bio/Emboss/Applications.py
Original author Brad Chapman, contributors named in the copyright
statements, and those only recorded via version control have all
agreed:

 - Adhemar Zerlotini (@azneto)
   https://github.com/biopython/biopython/pull/1412#issue-147372599
 - Brad Chapman (@chapmanb)
   http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html
 - Carlos Pena (@carlosp420)
   https://github.com/biopython/biopython/issues/898#issuecomment-236925650
 - Christian Brueffer (@cbrueffer)
   https://github.com/biopython/biopython/issues/898#issuecomment-236922857
 - David Winter (@dwinter)
   https://mailman.open-bio.org/pipermail/biopython/2018-December/016584.html
 - Michiel de Hoon (@mdehoon)
   https://github.com/biopython/biopython/issues/898#issuecomment-237122630
 - @morrme
   https://github.com/biopython/biopython/pull/1172#issuecomment-295430028
 - Peter Cock (@peterjc)
   https://github.com/biopython/biopython/issues/898#issue-167420613
 - Fei Qi (@qifei9)
   https://github.com/biopython/biopython/pull/1452
 - Leighton Pritchard (@widdowquinn)
   https://github.com/biopython/biopython/issues/898#issuecomment-236956165
 - Wibowo Arindrarto (@bow)
   https://github.com/biopython/biopython/issues/898#issuecomment-236920576
2018-12-20 09:22:15 +00:00
a251f31141 pydocstyle D400, ending docstring summary with period
Also now enforces this via TravisCI/Tox style checks.
2017-11-28 13:36:41 +00:00
7514c205f7 Fix Fuzznuc para and add Fuzzpro wrapper 2017-11-15 15:18:48 +00:00
50a89702eb flake8 docstring D412 and D413
D413 Missing blank line after last section
D412 No blank lines allowed between a section header and its content

(Seems adopting numpydoc naming means the flake8 plugin now
is stricter about section formatting and/or the machine I
did the previous commits on had an out of date flake plugin?)
2017-10-30 09:46:15 +00:00
f0790ebaf7 Moving to numpydoc section name Examples
Also moving examples below argument lists.
2017-10-30 09:46:15 +00:00
ba39e1f768 adding the docstring 'Initialize the class.' to every def __init__ with no docstring 2017-10-19 22:20:04 +01:00
be6b89e282 More RST tweaks to docstrings, mostly argument bullet lists 2017-06-16 12:46:00 +01:00
757e79fc5f changes to comply with pydocstyle rule D210 2017-05-08 15:09:38 +01:00
80988e819a corrections for pydocstyle rule D204 2017-05-07 22:36:29 +01:00
49cc6d7524 One-line docstring should fit on one line with quotes
Fix a lot but not all of these PEP257 docstring style
violations, reported by pydocstyle as D200.
2017-04-19 16:50:01 +01:00
2b63b38f53 More PEP8 whitespace in Bio/Emboss/Applications.py
$ pep8 --select E121 Bio/Emboss/Applications.py
$ pep8 Bio/Emboss/Applications.py
Bio/Emboss/Applications.py:131:80: E501 line too long (90 > 79 characters)
Bio/Emboss/Applications.py:141:80: E501 line too long (129 > 79 characters)
Bio/Emboss/Applications.py:145:80: E501 line too long (90 > 79 characters)
Bio/Emboss/Applications.py:151:80: E501 line too long (134 > 79 characters)
Bio/Emboss/Applications.py:176:80: E501 line too long (82 > 79 characters)
Bio/Emboss/Applications.py:211:80: E501 line too long (83 > 79 characters)
Bio/Emboss/Applications.py:268:80: E501 line too long (81 > 79 characters)
Bio/Emboss/Applications.py:424:80: E501 line too long (80 > 79 characters)
Bio/Emboss/Applications.py:448:80: E501 line too long (83 > 79 characters)
Bio/Emboss/Applications.py:475:80: E501 line too long (82 > 79 characters)
Bio/Emboss/Applications.py:541:80: E501 line too long (84 > 79 characters)
Bio/Emboss/Applications.py:773:80: E501 line too long (80 > 79 characters)
Bio/Emboss/Applications.py:891:80: E501 line too long (82 > 79 characters)
Bio/Emboss/Applications.py:997:80: E501 line too long (82 > 79 characters)
Bio/Emboss/Applications.py:1006:80: E501 line too long (82 > 79 characters)
Bio/Emboss/Applications.py:1199:80: E501 line too long (85 > 79 characters)
Bio/Emboss/Applications.py:1248:80: E501 line too long (87 > 79 characters)
Bio/Emboss/Applications.py:1253:80: E501 line too long (93 > 79 characters)
2016-06-13 17:34:09 +01:00
7e032629fb PEP8 whitespace Bio/Emboss/Applications.py 2016-06-13 16:45:49 +01:00
a007e3e60f Use our standard doctest stub 2016-05-24 16:14:03 +01:00
1119425f45 PEP8 E402 module level imports vs __docformat__ placement
This was mostly due to the latest version of the pep8
tool being stricter and wanting the __docformat__ line
after the module level imports.

Rather than moving them all, I removed them - and we'll
switch to using reStructuredText as the default when
converting the docstrings into API HTML pages for the
website.

This commit also includes assorted other PEP8 fixes which
our recommend git pre-commit hook spotted, and I fixed by
hand.
2016-05-10 17:13:46 +01:00
561d506db4 fix misspellings as spotted by codespell.py 2015-12-09 21:06:25 +00:00
4313804984 PEP8 and RST docstrings for Bio.codonalign, Bio.DocSQL, etc 2014-11-12 21:51:10 +09:00
b56c18a56a PEP8 fixes Emboss, Entrez, ExPASy 2014-11-01 14:43:46 +00:00
fca1a22252 Fixes for PEP8 E201 and E202 (whitespace before and after brackets). 2014-10-20 18:58:54 +01:00
0f8f1fc597 PEP8 fixes for E231 (missing whitespace after delimiters). 2014-10-20 10:33:37 +02:00
27826abf22 Remove EOF whitespace (PEP8 W391). 2014-10-17 15:40:41 +02:00
d076672d7f Add ePrimer3 option -opttm which replaces -otm in EMBOSS 6.6.0
This is a squashed commit from pull request #271 (modified by PJC).
2013-12-13 10:15:13 +00:00
14977ce666 Apply 2to3 ws_comma fixer (white space changes)
$ 2to3 --no-diffs -n -w -f ws_comma Bio BioSQL Tests Doc Scripts
2013-10-05 13:59:54 +01:00
de12c5e08f Add: from __future__ import print_statement
This is currently redundant as we are carefully only
using this simple print style which is both a print
statement (with redundant brackets) under Python 2
and a print function under Python 3:

print(variable)

However, adding the __future__ import to any file using
a print should catch any accidental usage of the print
statement in the near future (even if not testing under
Python 3 where it would be spotted since we've turned
off the print fixer during the 2to3 conversion).

This was automated as follows:

<python>
MAGIC = "from __future__ import print_function"

import os
import sys

def should_mark(filename):
    handle = open(filename, "rU")
    lines = [line.strip() for line in handle if "print" in line]
    handle.close()
    if MAGIC in lines:
        #print("%s is marked" % filename)
        return False
    if "print" in lines:
        print("TODO - %s has a naked print" % filename)
        sys.exit(1)
    for line in lines:
        if "print" not in line:
            continue
        #print(line)
        line = line.strip(" #")
        if line.startswith(">>>") or line.startswith("..."):
            #doctest
            line = line[3:].strip()
        if line.startswith("print ") or line.startswith("print("):
            return True
    print("%s has no print statements" % filename)
    return False

def mark_file(filename, marker=MAGIC):
    with open(filename, "rU") as h:
        lines = list(h.readlines())
    with open(filename, "w") as h:
        while (lines[0].startswith("#") or not lines[0].strip()):
            h.write(lines.pop(0))
        if lines[0].startswith('"""') or lines[0].startswith('r"""'):
            # Module docstring
            if lines[0].strip() == '"""':
                print("Non-PEP8 module docstring in %s" % filename)
            if lines[0].rstrip().endswith('"""') and lines[0].strip() != '"""':
                # One liner
                print("One line module docstring in %s" % filename)
                h.write(lines.pop(0))
            else:
                h.write(lines.pop(0))
                while not lines[0].strip().endswith('"""'):
                    h.write(lines.pop(0))
                h.write(lines.pop(0))
        while (lines[0].startswith("#") or not lines[0].strip()):
            h.write(lines.pop(0))
        h.write(marker + "\n\n")
        h.write("".join(lines))

for dirpath, dirnames, filenames in os.walk("."):
    if dirpath.startswith("./build/"):
        continue
    for f in filenames:
        if not f.endswith(".py"):
            continue
        f = os.path.join(dirpath, f)
        if should_mark(f):
            print("Marking %s" % f)
            mark_file(f)
</python>
2013-09-09 21:17:13 +01:00
b45cc28aaa Largely automated print function style in the doctests.
Plus some manual tweaking to ensure the doctests still pass
(e.g. on Jython 2.7b1, see last commit).

import os
from lib2to3.main import main

for dirpath, dirnames, filenames in os.walk("."):
    if dirpath.startswith("./build/") or dirpath.startwith("./.git/"):
        continue
    print("=" * len(dirpath))
    print(dirpath)
    print("=" *len(dirpath))
    for f in filenames:
        if not f.endswith(".py"):
            continue
        filename = os.path.join(dirpath, f)
        with open(filename) as h:
            data = h.read()
            if "print " not in data:
                continue
            if "print(" in data:
                continue
        print(filename)
        e = main("lib2to3.fixes", ["-d", filename, "-f", "print", "-w", "-n"])
        if e != 0:
            os.remove(filename)
            raise RuntimeError("Error %i from 2to3 (doctests) on %s"
                               % (e, filename))
2013-09-09 15:45:17 +01:00
32a20f4375 More typo and duplicate word fixes. 2012-12-24 12:34:52 +00:00
a7db23aa4b Add blank lines where needed (PEP8 E302). 2012-12-05 19:56:01 +08:00
651916372a Trim EOL whitespace (PEP8 W291, W293).
Whitespace in doctests and format examples has been left as is.
2012-12-04 17:51:22 +08:00
bow
f03bb45f1b updated: cli parameters for Water and Needle wrappers 2012-06-20 23:07:53 +01:00
bow
e644950bbf added: initial wrapper for EMBOSS needleall and stretcher 2012-06-20 23:07:33 +01:00
53f4841d05 Remove deprecated EMBOSS PHYLIP wrappers 2011-08-11 16:58:50 +01:00
6c90808165 Fixed typo in eprimer3 argument name (credit: Leighton Pritchard) 2011-03-07 15:02:54 +00:00
7d7c6b017d Update EMBOSS iep wrapper (add missing docstrings and -carboxyl option) and add doctest 2010-12-07 15:56:38 +00:00
6a93cb64e0 Fix typo in EMBOSS iep wrapper 2010-12-07 15:43:52 +00:00
fd99b976d5 Switch types=["file"] to filename=True in app wrapper parameters (private API change) 2010-12-07 15:40:46 +00:00
6957dd51be Make name and description mandatory in app wrappers
Note this changes the private API to the Bio.Application wrapper parameter classes.
2010-12-03 19:02:15 +00:00
beead6d070 Removed unneccessary line continuations 2010-12-02 21:41:21 +00:00
d7214f06ef Another stray _Option type, should have been in last commit 2010-12-02 20:26:57 +00:00
5188a0a75f Remove now unused input/output flags for app wrappers 2010-12-02 19:28:37 +00:00