Skip to content

Commit

Permalink
Update binners.py
Browse files Browse the repository at this point in the history
  • Loading branch information
8onlichtman authored Apr 1, 2024
1 parent 68793ee commit 7c7aea7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion prtpy/binners.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ def add_item_to_bin(self, bins:BinsArray, item: Any, bin_index: int)->BinsArray:
Return the bins after the addition.
"""
return bins


def remove_item_from_bin(self, bins:BinsArray, bin_index: int, item_index: int)->BinsArray:
sums, lists = bins
value = lists[bin_index][item_index]
sums[bin_index] -= value
del lists[bin_index][item_index]
return bins

@abstractmethod
def sort_by_ascending_sum(self, bins:BinsArray):
Expand All @@ -99,6 +105,8 @@ def numbins(self, bins: BinsArray) -> int:
"""
return None



@abstractmethod
def sums(self, bins: BinsArray) -> Tuple[float]:
"""
Expand Down

0 comments on commit 7c7aea7

Please sign in to comment.