Skip to content

Commit

Permalink
DOC: update typing
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcar17 committed Apr 24, 2024
1 parent 17f057d commit 9e4e37c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/cogent3/core/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
from cogent3.core.info import Info as InfoClass
from cogent3.core.profile import PSSM, MotifCountsArray
from cogent3.core.sequence import ArraySequence, Sequence, frac_same

# which is a circular import otherwise.
from cogent3.format.alignment import save_to_filename
from cogent3.format.fasta import alignment_to_fasta
Expand Down Expand Up @@ -1211,9 +1212,8 @@ def to_dict(self) -> dict[str, str]:
Returns
-------
dict[str, str]
a dict mapping sequence names to a string representation of
their sequences.
a dict mapping sequence names to a string representation of
their sequences.
"""
align_dict = {}

Expand Down
18 changes: 8 additions & 10 deletions src/cogent3/format/fasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,19 @@ def alignment_to_fasta(
Parameters
----------
alignment_dict : dict[str, str]
alignment_dict
dict of seq_name
block_size : int, optional
block_size
the sequence length to write to each line,
by default 60
order : Optional[list[str]], optional
order
optional list of sequence names, which order to print in.
Assumes complete and correct list of names,
by default None
Returns
-------
str
The alignment in the Fasta format.
The alignment in the Fasta format.
"""
order = order or []
return FastaFormatter().format(alignment_dict, block_size, order)
Expand All @@ -46,20 +45,19 @@ def format(
Parameters
----------
alignment_dict : dict[str, str]
alignment_dict
dict of seq_name
block_size : int, optional
block_size
the sequence length to write to each line,
by default 60
order : Optional[list[str]], optional
order
optional list of sequence names, which order to print in.
Assumes complete and correct list of names,
by default None
Returns
-------
str
The alignment in the Fasta format.
The alignment in the Fasta format.
"""
# setup
if not order:
Expand Down

0 comments on commit 9e4e37c

Please sign in to comment.