in Acquirer.acquire_batch there is a bug when explored is not None but does not contain at least k scores. This PR addresses that.
Current bug
the current_max is currently determined using np.partition to find the kth best score without sorting the full array of input scores. However, this will raise a ValueError when the length of that array is less than k.
Fix
A simple ternary statement: curr_max = np.partition(Y, -k)[-k] if len(Y) >= k else Y.max() covers all cases
Description
in
Acquirer.acquire_batch
there is a bug whenexplored
is notNone
but does not contain at leastk
scores. This PR addresses that.Current bug
the
current_max
is currently determined usingnp.partition
to find thek
th best score without sorting the full array of input scores. However, this will raise aValueError
when the length of that array is less thank
.Fix
A simple ternary statement:
curr_max = np.partition(Y, -k)[-k] if len(Y) >= k else Y.max()
covers all casesNotes
This PR also formats a few extraneous files
Relevant issues
N/A
Checklist