optimamodel / optima

Optima HIV software tool
http://optimamodel.com
GNU Lesser General Public License v3.0
7 stars 1 forks source link

Remove a potential divide by zero #1816

Closed Rowanmh closed 4 years ago

Rowanmh commented 4 years ago

... leading eventually to non-positive people error

cliffckerr commented 4 years ago

Actually @Rowanmh looking at it more closely, if trial_vec.sum() is zero then there's no point doing this loop, so best just to terminate, no?

ckerr-IDM commented 4 years ago

@Rowanmh I'm still curious about the case that resulted in this error. It seems like it should only happen if you're trying to optimize a budget of $0. The error could be more helpful, but I do think it's appropriate to throw an error in that case :) Do you remember what caused this originally?

Rowanmh commented 4 years ago

@cliffk - this happened when running a money minimization with some aggressive but achievable targets near saturation

cliffckerr commented 4 years ago

@Rowanmh Really? I don't understand how the entire vector is 0 though...my feeling is there's probably a deeper bug here. If you're able to reproduce reliably (setting the random seed), would be good to debug further...

cliffckerr commented 4 years ago

Superseded by #1814