-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prevent underflow when not enough material is available to make a packagable bid #621
Conversation
Build Status Report - f3637af - 2024-08-28 13:56:51 -0600Build
|
src/source.cc
Outdated
@@ -103,7 +103,10 @@ std::set<cyclus::BidPortfolio<cyclus::Material>::Ptr> Source::GetMatlBids( | |||
|
|||
// calculate packaging | |||
double bid_qty = context()->GetPackage(package)->GetFillMass(qty); | |||
int n_full_bids = static_cast<int>(std::floor(qty / bid_qty)); | |||
int n_full_bids = 0; | |||
if (bid_qty >= context()->GetPackage(package)->fill_min()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In mat_sell_policy
we only make sure that it's not 0 rather than compare to fill_min
. I wonder which one is more robust and more useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should also somehow return n_full_bids
from GetFillMass()
and handle this in a single robust way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing in cyclus#1790
I relaunched tests with the updates in cyclus |
This also requires cyclus#1795 for the python tests to pass on latest |
Now passes on latest - will merge. |
n_full_bids
could result in negative int max whenbid_qty
= 0, when it should be zeroRequires cyclus#1790 to be merged first!(merged)