Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions python/seqpro/_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import polars as pl
import polars_config_meta # noqa: F401
from attrs import define
from narwhals.typing import Frame, FrameT
from narwhals.typing import IntoFrame, IntoFrameT


@define(frozen=True)
Expand Down Expand Up @@ -58,7 +58,7 @@ def _resolve_schema(s: SchemaLike) -> CoordSchema:
)


def detect_schema(bed: Frame, hint: SchemaLike | None = None) -> CoordSchema:
def detect_schema(bed: IntoFrame, hint: SchemaLike | None = None) -> CoordSchema:
bed = nw.from_native(bed)

cols = set(bed.columns)
Expand Down Expand Up @@ -97,7 +97,9 @@ def detect_schema(bed: Frame, hint: SchemaLike | None = None) -> CoordSchema:
)


def set_schema(bed: FrameT, to: SchemaLike, from_: SchemaLike | None = None) -> FrameT:
def set_schema(
bed: IntoFrameT, to: SchemaLike, from_: SchemaLike | None = None
) -> IntoFrameT:
"""Rename coordinate columns to match a target schema.

Parameters
Expand Down
Loading