Skip to content
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

add recipes to source packaging tests to avoid undesired transmutation #617

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

nuclearkatie
Copy link
Contributor

I figured out why tests in #613 failed. After playing with it a bit, I kept getting results where the number of packaged resources was twice the number of transactions, which didn't make sense (every packaged resource should only be packaged in order to fulfill one transaction).

Then I realized that my tests didn't include an outrecipe, and the Mock Sink in the Mock Sim was for some reason requesting a different mock composition. So, immediately before trading, the Source transmuted the composition to the request composition, which creates a new line in the resource table, because the composition id (QualId I think) changed.

This is exactly the kind of extra and confusing resource database entries I mentioned above!

However, I still think it makes sense that resource should only be transmuted after they are packaged and ready to go, because we don't want to do transmuting until we're sure that the packaging will work. Which it normally will, but this keeps coming back to the challenge of requesting agents accepting partial-sized bids, which creates the chance of a failed trade by being an unpackagable amount.

In this case, I solved the issue by creating an outrecipe in my tests.

@nuclearkatie nuclearkatie mentioned this pull request Jul 18, 2024
@nuclearkatie nuclearkatie self-assigned this Jul 18, 2024
Copy link

github-actions bot commented Jul 18, 2024

Build Status Report - 8126c14 - 2024-07-18 13:00:44 -0500

Build FROM cyclus_20.04_apt/cyclus:latest
  • Cycamore: Success
  • Cymetric: Success
Build FROM cyclus_20.04_apt/cyclus:stable
  • Cycamore: Failure
  • Cymetric: Skipped due to upstream failure ⚠️
Build FROM cyclus_20.04_conda/cyclus:latest
  • Cycamore: Success
  • Cymetric: Success
Build FROM cyclus_20.04_conda/cyclus:stable
  • Cycamore: Failure
  • Cymetric: Skipped due to upstream failure ⚠️
Build FROM cyclus_22.04_apt/cyclus:latest
  • Cycamore: Success
  • Cymetric: Success
Build FROM cyclus_22.04_apt/cyclus:stable
  • Cycamore: Failure
  • Cymetric: Skipped due to upstream failure ⚠️
Build FROM cyclus_22.04_conda/cyclus:latest
  • Cycamore: Success
  • Cymetric: Success
Build FROM cyclus_22.04_conda/cyclus:stable
  • Cycamore: Failure
  • Cymetric: Skipped due to upstream failure ⚠️

@nuclearkatie nuclearkatie marked this pull request as ready for review July 18, 2024 18:16
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nuclearkatie - this looks like it fixes the problem. Do you think it reduces the generality/breadth of the testing? should some version of this work without an outrecipe?

@gonuke gonuke merged commit 2724432 into cyclus:main Jul 18, 2024
10 checks passed
@nuclearkatie
Copy link
Contributor Author

nuclearkatie commented Jul 18, 2024

The only difference if I didn't add an outrecipe is that the transactions would stay the same but the number of packaged resource entries in the database would always be 2 * transactions. I didn't think that warranted an additional test.

Also in some of the demonstration input files I've made to run full, real simulations, the requested composition didn't necessarily change, which is why I added the bit about preventing transmutation if the requested composition is the same as the existing composition (I have to admit I don't really understand mock compositions here, and when they might be the same and when they might be different). So I'm not even sure this is would be an issue in full simulations.

Plus, it should show up on the resource table as the QualId having changed if transmutation occurs, which is a visible flag that something did actually change to warrant a new resource line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants