Skip to content

Commit

Permalink
DEV: resolve clash between c3 Sequence and typing.Sequence, to_html o…
Browse files Browse the repository at this point in the history
…n AlignmentI now works with immutable name_order
  • Loading branch information
rmcar17 committed May 1, 2024
1 parent ce5e91a commit 35fdf9b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cogent3/core/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ def seqs(self):

# access as attribute if using default order.

def take_seqs(self, seqs: Union[str, Sequence[str]], negate=False, **kwargs):
def take_seqs(self, seqs: Union[str, typing.Sequence[str]], negate=False, **kwargs):
"""Returns new Alignment containing only specified seqs.
Note that the seqs in the new alignment will be references to the
Expand Down Expand Up @@ -2198,7 +2198,7 @@ def _repr_html_(self) -> str:

def to_html(
self,
name_order: Optional[Sequence[str]] = None,
name_order: Optional[typing.Sequence[str]] = None,
wrap: int = 60,
limit: Optional[int] = None,
colors: Optional[Mapping[str, str]] = None,
Expand Down Expand Up @@ -3107,7 +3107,7 @@ def _repr_html_(self) -> str:

def to_html(
self,
name_order: Optional[Sequence[str]] = None,
name_order: Optional[typing.Sequence[str]] = None,
wrap: int = 60,
limit: Optional[int] = None,
ref_name: str = "longest",
Expand Down Expand Up @@ -3148,6 +3148,7 @@ def to_html(
)
if name_order:
selected = self.take_seqs(name_order)
name_order = list(name_order)
else:
name_order = list(self.names)
ref_name = ref_name or "longest"
Expand Down

0 comments on commit 35fdf9b

Please sign in to comment.