_recommend can KeyError when peak-clamped node count isn't in node_grid
#18
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In
nix_estimator/estimate.py,_recommenddoeschosen_nodes = min(chosen_nodes, max(1, peak))and then indexesat[chosen_nodes](and returnsest_makespan_min = round(at[chosen_nodes], 1)). Butatis keyed only by the values present innode_grid. When the graph'speakconcurrency is smaller than every element ofnode_grid(or otherwise not one of the swept node counts),min(chosen_nodes, peak)produces a value that is not a key inat, raisingKeyError. Example:node_grid=(2,4,8)withpeak=1→chosen_nodes=1,at[1]→ KeyError.Implementation: after clamping, snap
chosen_nodesto the largestnode_gridvalue ≤ the clamp target (or the smallest available if none qualifies), so it is always a valid key inat. Alternatively compute makespan for the clamped node count on demand. Add a regression test withnode_gridwhose minimum exceedspeak.Discovered during work on issue #11.
Fixed and merged to main (commit
837b885).