Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Dec 27, 2023
1 parent a287153 commit 15946a8
Showing 4 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/summarizedexperiment/BaseSE.py
Original file line number Diff line number Diff line change
@@ -1062,4 +1062,4 @@ def to_anndata(self):
layers=layers,
)

return obj
return obj
16 changes: 8 additions & 8 deletions src/summarizedexperiment/RangedSummarizedExperiment.py
Original file line number Diff line number Diff line change
@@ -967,10 +967,10 @@ def combine_columns(*x: RangedSummarizedExperiment) -> RangedSummarizedExperimen

@ut.relaxed_combine_rows.register(RangedSummarizedExperiment)
def relaxed_combine_rows(*x: RangedSummarizedExperiment) -> RangedSummarizedExperiment:
"""A relaxed version of the :py:func:`~biocutils.combine_rows.combine_rows` method for :py:class:`~RangedSummarizedExperiment`
objects. Whereas ``combine_rows`` expects that all objects have the same columns, ``relaxed_combine_rows`` allows
for different columns. Absent columns in any object are filled in with appropriate placeholder values before
combining.
"""A relaxed version of the :py:func:`~biocutils.combine_rows.combine_rows` method for
:py:class:`~RangedSummarizedExperiment` objects. Whereas ``combine_rows`` expects that all objects have the same
columns, ``relaxed_combine_rows`` allows for different columns. Absent columns in any object are filled in with
appropriate placeholder values before combining.
Args:
x:
@@ -1008,10 +1008,10 @@ def relaxed_combine_rows(*x: RangedSummarizedExperiment) -> RangedSummarizedExpe
def relaxed_combine_columns(
*x: RangedSummarizedExperiment,
) -> RangedSummarizedExperiment:
"""A relaxed version of the :py:func:`~biocutils.combine_rows.combine_columns` method for :py:class:`~RangedSummarizedExperiment`
objects. Whereas ``combine_columns`` expects that all objects have the same rows, ``relaxed_combine_columns`` allows
for different rows. Absent columns in any object are filled in with appropriate placeholder values before
combining.
"""A relaxed version of the :py:func:`~biocutils.combine_rows.combine_columns` method for
:py:class:`~RangedSummarizedExperiment` objects. Whereas ``combine_columns`` expects that all objects have the same
rows, ``relaxed_combine_columns`` allows for different rows. Absent columns in any object are filled in with
appropriate placeholder values before combining.
Args:
x:
16 changes: 8 additions & 8 deletions src/summarizedexperiment/SummarizedExperiment.py
Original file line number Diff line number Diff line change
@@ -163,10 +163,10 @@ def combine_columns(*x: SummarizedExperiment) -> SummarizedExperiment:

@ut.relaxed_combine_rows.register(SummarizedExperiment)
def relaxed_combine_rows(*x: SummarizedExperiment) -> SummarizedExperiment:
"""A relaxed version of the :py:func:`~biocutils.combine_rows.combine_rows` method for :py:class:`~SummarizedExperiment`
objects. Whereas ``combine_rows`` expects that all objects have the same columns, ``relaxed_combine_rows`` allows
for different columns. Absent columns in any object are filled in with appropriate placeholder values before
combining.
"""A relaxed version of the :py:func:`~biocutils.combine_rows.combine_rows` method for
:py:class:`~SummarizedExperiment` objects. Whereas ``combine_rows`` expects that all objects have the same columns,
``relaxed_combine_rows`` allows for different columns. Absent columns in any object are filled in with appropriate
placeholder values before combining.
Args:
x:
@@ -198,10 +198,10 @@ def relaxed_combine_rows(*x: SummarizedExperiment) -> SummarizedExperiment:

@ut.relaxed_combine_columns.register(SummarizedExperiment)
def relaxed_combine_columns(*x: SummarizedExperiment) -> SummarizedExperiment:
"""A relaxed version of the :py:func:`~biocutils.combine_rows.combine_columns` method for :py:class:`~SummarizedExperiment`
objects. Whereas ``combine_columns`` expects that all objects have the same rows, ``relaxed_combine_columns`` allows
for different rows. Absent columns in any object are filled in with appropriate placeholder values before
combining.
"""A relaxed version of the :py:func:`~biocutils.combine_rows.combine_columns` method for
:py:class:`~SummarizedExperiment` objects. Whereas ``combine_columns`` expects that all objects have the same rows,
``relaxed_combine_columns`` allows for different rows. Absent columns in any object are filled in with appropriate
placeholder values before combining.
Args:
x:
19 changes: 15 additions & 4 deletions tests/test_SE_combine_cols.py
Original file line number Diff line number Diff line change
@@ -43,7 +43,11 @@ def test_SE_combine_cols_with_names_mixed(summarized_experiments):
assert combined.shape == (3, 6)
assert set(combined.assay_names).issubset(["counts", "lognorm"])
assert list(combined.row_data.column_names) == ["seqnames", "start", "end"]
assert list(combined.column_data.column_names) == ['sample', 'disease', 'doublet_score']
assert list(combined.column_data.column_names) == [
"sample",
"disease",
"doublet_score",
]
assert combined.row_names is not None
assert len(combined.row_names) == 3
assert combined.column_names is not None
@@ -58,7 +62,11 @@ def test_SE_combine_cols_with_names_mixed(summarized_experiments):
assert combined.shape == (3, 6)
assert set(combined.assay_names).issubset(["counts", "lognorm"])
assert list(combined.row_data.column_names) == ["seqnames", "start", "end"]
assert list(combined.column_data.column_names) == ['sample', 'disease', 'doublet_score']
assert list(combined.column_data.column_names) == [
"sample",
"disease",
"doublet_score",
]
assert combined.row_names is not None
assert len(combined.row_names) == 3
assert combined.column_names is not None
@@ -77,7 +85,11 @@ def test_SE_both_combine_cols_with_names(summarized_experiments):
assert combined.shape == (3, 6)
assert set(combined.assay_names).issubset(["counts", "lognorm"])
assert list(combined.row_data.column_names) == ["seqnames", "start", "end"]
assert list(combined.column_data.column_names) == ['sample', 'disease', 'doublet_score']
assert list(combined.column_data.column_names) == [
"sample",
"disease",
"doublet_score",
]
assert combined.row_names is not None
assert len(combined.row_names) == 3
assert combined.column_names is not None
@@ -95,4 +107,3 @@ def test_SE_both_combine_cols_with_names(summarized_experiments):
assert len(combined.column_data.column_names) > 2
assert combined.row_names is not None
assert combined.column_names is not None

0 comments on commit 15946a8

Please sign in to comment.