In _get_cost_matrix there is a check for empty frames via input_pairs. However, this will not catch empty frames correctly because _get_input_pairs will fail when attempting to assemble an empty list with np.stack resulting in ValueError: need at least one array to stack. This error could more appropriately be circumvented by checking for empty frames at the beginning of _get_cost_matrix via cells_in_frame. A warning should also be logged in this circumstance.
In
_get_cost_matrix
there is a check for empty frames viainput_pairs
. However, this will not catch empty frames correctly because_get_input_pairs
will fail when attempting to assemble an empty list withnp.stack
resulting inValueError: need at least one array to stack
. This error could more appropriately be circumvented by checking for empty frames at the beginning of_get_cost_matrix
viacells_in_frame
. A warning should also be logged in this circumstance.