From 15946a89532856c6800c42e026ca8622b6de8ef8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:26:27 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/summarizedexperiment/BaseSE.py | 2 +- .../RangedSummarizedExperiment.py | 16 ++++++++-------- .../SummarizedExperiment.py | 16 ++++++++-------- tests/test_SE_combine_cols.py | 19 +++++++++++++++---- 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/summarizedexperiment/BaseSE.py b/src/summarizedexperiment/BaseSE.py index 4845e0e..14229e2 100644 --- a/src/summarizedexperiment/BaseSE.py +++ b/src/summarizedexperiment/BaseSE.py @@ -1062,4 +1062,4 @@ def to_anndata(self): layers=layers, ) - return obj \ No newline at end of file + return obj diff --git a/src/summarizedexperiment/RangedSummarizedExperiment.py b/src/summarizedexperiment/RangedSummarizedExperiment.py index 8386902..735b509 100644 --- a/src/summarizedexperiment/RangedSummarizedExperiment.py +++ b/src/summarizedexperiment/RangedSummarizedExperiment.py @@ -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: diff --git a/src/summarizedexperiment/SummarizedExperiment.py b/src/summarizedexperiment/SummarizedExperiment.py index b0d04f3..ebdc718 100644 --- a/src/summarizedexperiment/SummarizedExperiment.py +++ b/src/summarizedexperiment/SummarizedExperiment.py @@ -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: diff --git a/tests/test_SE_combine_cols.py b/tests/test_SE_combine_cols.py index 71be166..4aafc22 100644 --- a/tests/test_SE_combine_cols.py +++ b/tests/test_SE_combine_cols.py @@ -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 -