oasislmf.pytools.common.utils.nb_heapq

Functions

heap_push(heap, size, element)

Heapq heappush

heap_pop(heap, size)

Heapq heappop

init_heap([num_rows, num_compare])

Initialise heap with (num_compare + 2) * num_rows elements, where

Module Contents

oasislmf.pytools.common.utils.nb_heapq.heap_push(heap, size, element)[source]

Heapq heappush

oasislmf.pytools.common.utils.nb_heapq.heap_pop(heap, size)[source]

Heapq heappop

oasislmf.pytools.common.utils.nb_heapq.init_heap(num_rows=4, num_compare=1)[source]

Initialise heap with (num_compare + 2) * num_rows elements, where num_compare is the number of elements to order by in lexicographical order, and the remaining two elements are the file and row idxs

Currently limited to dtype np.int32 as it is tricky to use custom dtypes