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..58e8873 100644 --- a/src/compressed_lists/biocframe_list.py +++ b/src/compressed_lists/biocframe_list.py @@ -159,6 +159,22 @@ 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 _(