Skip to content

Commit

Permalink
Standardize class init docstrings (biopython#3529)
Browse files Browse the repository at this point in the history
Standardize class initialization comment throughout project
  • Loading branch information
amorehead authored and JoaoRodrigues committed Jun 3, 2021
1 parent 1150199 commit 448cfb9
Show file tree
Hide file tree
Showing 23 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Bio/Affy/CelFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Record:
"""

def __init__(self):
"""Initialize class."""
"""Initialize the class."""
self.version = None
self.GridCornerUL = None
self.GridCornerUR = None
Expand Down
2 changes: 1 addition & 1 deletion Bio/AlignIO/MauveIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class MauveWriter(SequentialAlignmentWriter):
"""Mauve/XMFA alignment writer."""

def __init__(self, *args, **kwargs):
"""Initialize."""
"""Initialize the class."""
super().__init__(*args, **kwargs)
self._wrote_header = False
self._wrote_first = False
Expand Down
2 changes: 1 addition & 1 deletion Bio/Application/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ApplicationError(subprocess.CalledProcessError):
"""

def __init__(self, returncode, cmd, stdout="", stderr=""):
"""Initialize."""
"""Initialize the class."""
self.returncode = returncode
self.cmd = cmd
self.stdout = stdout
Expand Down
2 changes: 1 addition & 1 deletion Bio/Entrez/Parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class DataHandlerMeta(type):
"""A metaclass is needed until Python supports @classproperty."""

def __init__(cls, *args, **kwargs):
"""Initialize."""
"""Initialize the class."""
cls._directory = None

@property
Expand Down
8 changes: 4 additions & 4 deletions Bio/GenBank/Record.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class Record:
SEQUENCE_FORMAT = "%" + str(GB_SEQUENCE_INDENT) + "s"

def __init__(self):
"""Initialize."""
"""Initialize the class."""
self.accession = []
self.base_counts = ""
self.comment = ""
Expand Down Expand Up @@ -512,7 +512,7 @@ class Reference:
"""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
self.number = ""
self.bases = ""
self.authors = ""
Expand Down Expand Up @@ -617,7 +617,7 @@ class Feature:
"""

def __init__(self, key="", location=""):
"""Initialize."""
"""Initialize the class."""
self.key = key
self.location = location
self.qualifiers = []
Expand Down Expand Up @@ -647,7 +647,7 @@ class Qualifier:
"""

def __init__(self, key="", value=""):
"""Initialize."""
"""Initialize the class."""
self.key = key
self.value = value

Expand Down
2 changes: 1 addition & 1 deletion Bio/GenBank/Scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class InsdcScanner:
SEQUENCE_HEADERS = ["XXX"] # with right hand side spaces removed

def __init__(self, debug=0):
"""Initialize."""
"""Initialize the class."""
assert len(self.RECORD_START) == self.HEADER_WIDTH
for marker in self.SEQUENCE_HEADERS:
assert marker == marker.rstrip()
Expand Down
2 changes: 1 addition & 1 deletion Bio/Graphics/BasicChromosome.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Organism(_ChromosomeComponent):
"""

def __init__(self, output_format="pdf"):
"""Initialize."""
"""Initialize the class."""
_ChromosomeComponent.__init__(self)

# customizable attributes
Expand Down
2 changes: 1 addition & 1 deletion Bio/Graphics/Comparative.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ComparativeScatterPlot:
"""

def __init__(self, output_format="pdf"):
"""Initialize."""
"""Initialize the class."""
# customizable attributes
self.number_of_columns = 1
self.page_size = letter
Expand Down
4 changes: 2 additions & 2 deletions Bio/Graphics/Distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DistributionPage:
"""

def __init__(self, output_format="pdf"):
"""Initialize."""
"""Initialize the class."""
self.distributions = []

# customizable attributes
Expand Down Expand Up @@ -250,7 +250,7 @@ class LineDistribution:
"""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
pass

def draw(self, cur_drawing, start_x, start_y, end_x, end_y):
Expand Down
2 changes: 1 addition & 1 deletion Bio/Graphics/KGML_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(
show_reaction_entries=True,
margins=(0.02, 0.02),
):
"""Initialize."""
"""Initialize the class."""
self.pathway = pathway
self.show_maps = show_maps
self.show_orthologs = show_orthologs
Expand Down
2 changes: 1 addition & 1 deletion Bio/HMM/DynamicProgramming.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,5 +322,5 @@ class LogDPAlgorithms(AbstractDPAlgorithms):
"""

def __init__(self, markov_model, sequence):
"""Initialize."""
"""Initialize the class."""
raise NotImplementedError("Haven't coded this yet...")
4 changes: 2 additions & 2 deletions Bio/HMM/Trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AbstractTrainer:
"""Provide generic functionality needed in all trainers."""

def __init__(self, markov_model):
"""Initialize."""
"""Initialize the class."""
self._markov_model = markov_model

def log_likelihood(self, probabilities):
Expand Down Expand Up @@ -355,7 +355,7 @@ class KnownStateTrainer(AbstractTrainer):
"""

def __init__(self, markov_model):
"""Initialize."""
"""Initialize the class."""
AbstractTrainer.__init__(self, markov_model)

def train(self, training_seqs):
Expand Down
2 changes: 1 addition & 1 deletion Bio/LogisticRegression.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LogisticRegression:
"""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
self.beta = []


Expand Down
6 changes: 3 additions & 3 deletions Bio/PDB/HSExposure.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class _AbstractHSExposure(AbstractPropertyMap):
"""

def __init__(self, model, radius, offset, hse_up_key, hse_down_key, angle_key=None):
"""Initialize.
"""Initialize class.
:param model: model
:type model: L{Model}
Expand Down Expand Up @@ -140,7 +140,7 @@ class HSExposureCA(_AbstractHSExposure):
"""

def __init__(self, model, radius=12, offset=0):
"""Initialse class.
"""Initialize class.
:param model: the model that contains the residues
:type model: L{Model}
Expand Down Expand Up @@ -275,7 +275,7 @@ class ExposureCN(AbstractPropertyMap):
"""Residue exposure as number of CA atoms around its CA atom."""

def __init__(self, model, radius=12.0, offset=0):
"""Initialize.
"""Initialize class.
A residue's exposure is defined as the number of CA atoms around
that residue's CA atom. A dictionary is returned that uses a L{Residue}
Expand Down
4 changes: 2 additions & 2 deletions Bio/SearchIO/_legacy/NCBIStandalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ class BlastParser(AbstractParser):
"""Parses BLAST data into a Record.Blast object."""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
self._scanner = _Scanner()
self._consumer = _BlastConsumer()

Expand All @@ -864,7 +864,7 @@ class PSIBlastParser(AbstractParser):
"""Parses BLAST data into a Record.PSIBlast object."""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
self._scanner = _Scanner()
self._consumer = _PSIBlastConsumer()

Expand Down
2 changes: 1 addition & 1 deletion Bio/kNN.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class kNN:
"""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
self.classes = set()
self.xs = []
self.ys = []
Expand Down
2 changes: 1 addition & 1 deletion Bio/motifs/alignace.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Record(list):
"""AlignACE record (subclass of Python list)."""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
self.parameters = None


Expand Down
2 changes: 1 addition & 1 deletion Bio/motifs/meme.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Record(list):
"""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
self.version = ""
self.datafile = ""
self.command = ""
Expand Down
2 changes: 1 addition & 1 deletion Bio/motifs/transfac.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Record(list):
"""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
self.version = None

def __str__(self):
Expand Down
2 changes: 1 addition & 1 deletion Scripts/xbbtools/xbb_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class xbb_translations:
"""A class for doing translations."""

def __init__(self):
"""Initialize."""
"""Initialize the class."""
pass

def frame1(self, seq, translation_table=1):
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_KGML_graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PathwayData:
"""Convenience structure for testing pathway data."""

def __init__(self, name, element_counts, show_pathway_image=False):
"""Initialize."""
"""Initialize the class."""
self.infilename = os.path.join("KEGG", "ko%s.xml" % name)
self.outfilename = os.path.join("KEGG", "ko%s.kgml" % name)
self.element_counts = element_counts
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_KGML_nographics.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(
pathway_image,
show_pathway_image=False,
):
"""Initialize."""
"""Initialize the class."""
self.infilename = infilename
self.outfilename = outfilename
self.element_counts = element_counts
Expand Down
2 changes: 1 addition & 1 deletion Tests/test_SeqIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class ForwardOnlyHandle:
"""Mimic a network handle without seek and tell methods etc."""

def __init__(self, handle):
"""Initialize."""
"""Initialize the class."""
self._handle = handle

def __iter__(self):
Expand Down

0 comments on commit 448cfb9

Please sign in to comment.