Skip to content

Commit

Permalink
Register biocutils relaxed combine generics (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche authored Dec 27, 2023
1 parent 37a8e07 commit 66dbd15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ python_requires = >=3.8
# For more information, check out https://semver.org/.
install_requires =
importlib-metadata; python_version<"3.8"
biocutils>=0.1.2
biocutils>=0.1.4,<0.2.0
numpy

[options.packages.find]
Expand Down
2 changes: 2 additions & 0 deletions src/biocframe/BiocFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,7 @@ def _construct_missing(col, n):
return [None] * n


@ut.relaxed_combine_rows.register(BiocFrame)
def relaxed_combine_rows(*x: BiocFrame) -> BiocFrame:
"""A relaxed version of the :py:func:`~biocutils.combine_rows.combine_rows` method for :py:class:`~BiocFrame`
objects. Whereas ``combine_rows`` expects that all objects have the same columns, ``relaxed_combine_rows`` allows
Expand Down Expand Up @@ -1584,6 +1585,7 @@ def merge(
############################


@ut.relaxed_combine_columns.register(BiocFrame)
def relaxed_combine_columns(*x: BiocFrame) -> BiocFrame:
"""Wrapper around :py:func:`~merge` that performs a left join on the row names."""
return merge(x, join="left", by=None)

0 comments on commit 66dbd15

Please sign in to comment.