From 73b8dfe3f5ac136f029d5c0acd1dec6fcd618d2d Mon Sep 17 00:00:00 2001 From: Jayaram Kancherla Date: Wed, 13 May 2026 20:35:42 -0700 Subject: [PATCH 1/2] Fix initializing an empty compressed dataframe list --- CHANGELOG.md | 2 +- src/compressed_lists/base.py | 2 +- src/compressed_lists/biocframe_list.py | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b492c5a..7f4a788 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Version 0.4.0 - 0.4.4 +## Version 0.4.0 - 0.4.5 - Classes extend `BiocObject` from biocutils. `metadata` is a named list. - Update actions to run from 3.10-3.14 diff --git a/src/compressed_lists/base.py b/src/compressed_lists/base.py index de25376..53aa35c 100644 --- a/src/compressed_lists/base.py +++ b/src/compressed_lists/base.py @@ -637,7 +637,7 @@ def empty(cls, n: int): _range_lengths = [0] * n - return CompressedList(unlist_data=[], partitioning=Partitioning(ends=_range_lengths)) + return cls(unlist_data=[], partitioning=Partitioning(ends=_range_lengths)) ####################### ######>> extend <<##### diff --git a/src/compressed_lists/biocframe_list.py b/src/compressed_lists/biocframe_list.py index 0a63213..2634def 100644 --- a/src/compressed_lists/biocframe_list.py +++ b/src/compressed_lists/biocframe_list.py @@ -159,6 +159,21 @@ def __str__(self) -> str: return output + @classmethod + def empty(cls, n: int): + """Create an zero-length `CompressedSplitBiocFrameList` object. + + Args: + n: + Number of elements. + + Returns: + same type as caller, in this case a `CompressedSplitBiocFrameList`. + """ + + _range_lengths = [0] * n + + return cls(unlist_data=BiocFrame({}), partitioning=Partitioning(ends=_range_lengths)) @splitAsCompressedList.register def _( From 17972c34c931edbcd64c7d4f6208e57fd9bacb1b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 May 2026 03:37:24 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/compressed_lists/biocframe_list.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compressed_lists/biocframe_list.py b/src/compressed_lists/biocframe_list.py index 2634def..58e8873 100644 --- a/src/compressed_lists/biocframe_list.py +++ b/src/compressed_lists/biocframe_list.py @@ -175,6 +175,7 @@ def empty(cls, n: int): return cls(unlist_data=BiocFrame({}), partitioning=Partitioning(ends=_range_lengths)) + @splitAsCompressedList.register def _( data: BiocFrame,