-
Notifications
You must be signed in to change notification settings - Fork 0
Fix Tests for new Decay on Absorb behavior #2
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
base: decay_absorb
Are you sure you want to change the base?
Conversation
|
@gonuke Doesn't look like I have permission to add you as a reviewer, so pinging you like this so it (hopefully) shows up in your inbox |
|
Thanks for the fixes here @dean-krueger All the other decay tests work without a context. I think we may want to have some tests that just decay these different materials directly (ie. without a context) and then some that rely on the context. |
|
I'm not totally clear on what you mean by your comment, but I'll do my best to respond to what I think you mean? The context is important for this specific test where it may not be for others because the new decay on absorb functionality is fundamentally linked to the time at which the materials are said to have been decayed. Since time lives in the context, we need to have it for this particular test. Since this test is specific to the behavior of materials decay when they are combined with the |
|
A couple of related things:
|
A few questions about this:
Is it possible (or more importantly "indented under normal operation") for Cyclus' context to go backwards in time? I didn't think it was, in which case I agree that this would be a bug, and would then argue that a material absorb test is probably not the place to make sure this isn't happening. As always happy to do whatever, just wanted to make sure we were on the same page! |
|
Regarding the context:
|
|
Regarding backward decay:
|
|
Gotcha. I'm going to advocate for moving this conversation/issue to the main PR and separating it from this PR, which simply aims to fix those two failing tests. I will make a comment in the main PR about adding additional tests and reference your explanations. |
|
Refactor these such that we use the REAL context (not the fake context). @gonuke and I talked about one or two other things maybe but I forget what they were. Perhaps I will remember while I'm fixing the first thing, or maybe he'll leave a comment if he remembers. |
This PR fixes the (/at least) two tests that seemed to be failing in the Cyclus build. The two failing tests were:
MaterialTest.AbsorbPrevDecayandResourceTest.MaterialUnitValueMaterialTest.AbsorbPrevDecaywas fixed by adding a fake context to the simulation and then stepping through fakectx->time and checking that absorb records the correct timestamp (should be 11)ResourceTest.MaterialUnitValuewas failing because when you made the change in thematerial.ccAbsorbfunction you accidentally deleted the part that averages the unit value of combined materials. I added that bit back and this test started passing! I guess this just goes to show why tests are so valuable! 😁Either way, this PR should fix at least those two tests, and they were the ones I saw that were failing in your Cyclus PR, so hopefully this fixes that and then we're good to go!