Feature/69 balanced penaltymodels
Hi Melody, the matlab function for getting exact fractions out of approximate ones is call rats() (rational fraction approximation). The fractions python module has a similar function. For example, to get 0.5 from 0.499999: from fractions import Fraction float(Fraction.from_float(0.499999).limit_denominator(10**5)) However I think this would need to tested pretty carefully to make sure it's doing the right thing, and it would be better to get the right answers out of the linear programming in the first place, if possible
Sorry for the late reply! @aidanproy
Verifying PM Gaps No, the gap of the constructed penaltymodel gap is not verified. As you've noted, typically, these penaltymodels are constructed by the penaltymodel factories that would find solutions based on that gap, so the check would be redundant in that case.
For the case where a user constructs their own penaltymodel, at the moment, we are not verifying their models. I am on the fence about verifying this because it seems like a very atypical case to me at the moment. Plus, I don't want this verification to happen for the factory-constructed-penaltymodel cases.
On number of tries You suggestion makes sense. I will go about implementing that
Sorry for the late reply! @aidanproy
Verifying PM Gaps No, the gap of the constructed penaltymodel gap is not verified. As you've noted, typically, these penaltymodels are constructed by the penaltymodel factories that would find solutions based on that gap, so the check would be redundant in that case.
For the case where a user constructs their own penaltymodel, at the moment, we are not verifying their models. I am on the fence about verifying this because it seems like a very atypical case to me at the moment. Plus, I don't want this verification to happen for the factory-constructed-penaltymodel cases.
That makes sense. It might be useful if there was a "verify_penaltymodel" function exposed in the interface somewhere, even if we don't use it directly. That way if the user happened to build their own, it would be easy for them to check it themselves.
Closing this PR as stale.