Skip to content

Commit bb2f8aa

Browse files
authored
minor edits to test and docstring (#4)
1 parent 9ad618b commit bb2f8aa

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## Version 0.1.0
3+
## Version 0.1.0 - 0.1.1
44

55
- Initial implementation of various classes - Partitioning and CompressedLists.
66
- Udpate documentation, tutorial and tests.

src/compressed_lists/partition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, ends: Sequence[int], names: Optional[Sequence[str]] = None, v
2929
3030
Args:
3131
ends:
32-
Sequence of ending positions for each partition.
32+
Sequence of ending positions for each partition (exclusive).
3333
3434
names:
3535
Optional names for each partition.

tests/test_comp_int.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ def test_creation(int_data):
2828
assert list(int_list.get_element_lengths()) == [3, 2, 4]
2929

3030

31+
def test_creation_from_parts():
32+
int_list = CompressedIntegerList(np.array([1, 2, 3, 4, 5, 6, 7, 8, 9]), Partitioning(ends=[3, 5, 9]))
33+
34+
assert len(int_list) == 3
35+
assert isinstance(int_list.unlist_data, np.ndarray)
36+
assert list(int_list.get_unlist_data()) == [1, 2, 3, 4, 5, 6, 7, 8, 9]
37+
assert list(int_list.get_element_lengths()) == [3, 2, 4]
38+
39+
3140
def test_creation_with_names(int_data):
3241
names = ["A", "B", "C"]
3342
int_list = CompressedIntegerList.from_list(int_data, names)

0 commit comments

Comments
 (0)