-
Notifications
You must be signed in to change notification settings - Fork 90
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
r.core.growToFullCore() error when loading from database #582
Comments
To fix this the database3 update global assembly number function should be called on the database load function. This is automatically done on the database interface loadState but isn't called if you just want to load a reactor with .load |
@jasonbmeng It would really help me fix this bug if you could copy/paste the actual error / stack trace below. Thanks! @jakehader Are you saying this is a known bug, because this line is called when loading a reactor from DB, not when normally initializing a reactor? armi/armi/bookkeeping/db/database3.py Lines 144 to 147 in a3f23ed
|
Sure thing, @john-science. Here's the stack trace when running
|
I am saying that I worked with Jason when he was having this issue and the |
I went in to fix this bug this morning, and was unable to reproduce it. For example, please see these unit tests where I try to reproduce the bug: |
Dang okay. @jasonbmeng you might need pass the problem or failing case to @john-science internally. This might be a combination of things leading to the problem then. |
Thanks to Jeff, I was able to reproduce this bug with a database he gave me. I will take on solving the bug. Though I still can not generate a pure-ARMI unit test that reproduces this bug. And that would obviously be helpful for both debugging and as a final test in the solution PR. |
John, This test demonstrates the issue. It passes as written, throwing a
|
Yeah, I have various versions of this, but they pass unless provided special databases: Interestingly, the default ARMI test data doesn't seem to reproduce this bug. This is a 1/3 core situation:
For example, I can generate the default H5 file used in dozens of unit tests, but the test passes without generating the error: def test_growToFullCoreFromFactory(self):
from armi.bookkeeping.db import databaseFactory
db = databaseFactory(self.dbName, "r")
with db:
r = db.load(0, 0, allowMissing=True)
r.core.growToFullCore(None) So, that's fun. |
Have you run that test method by itself? The reason all of the mech unit tests passed was because we were loading databases many times before the process got to the one that tested the full core growth. When I run the grow to full core unit test method only, it fails. I didn't try all of our test databases, but the two I tried both exhibited this problem. |
Yeah, as my personal workflow goes, I am only running this one test. You can easily run one test by doing:
Just to be clear:
I was just hoping to simplify the process in (2) with an ARMI-only test case. And I"m a little worried that I won't be able to write a decent unit test for my PR to fix this because I haven't been able to reproduce this with a pure ARMI unit test. |
So, the problem appears to be around here:
Essentially, if you run a I have no found the bug yet. I am trying to unwind the 'load a core from a database' logical flow, to find where there is a misstep. EDIT: And, of course, |
So, I have a solution! The only problem I'm facing right now is: I can't generate a unit test that fails for this bug. So I can't really prove that my fix works. But the fix does work for certain trial databases users have given me. |
It turns out the this fix caused some errors for a downstream project, and so I am reopening this ticket. |
@john-science can you elaborate on the issue/bug now? |
I believe this issue has been fixed via #615 and can be closed. |
Oh has it? I thought this was still outstanding. |
Based on a conversation with Jason, this ticket appears to be complete. Hurray! |
Discussed with @jakehader. When loading a reactor using a case settings file, mechanical team is able to grow to full core. When loading a reactor object from a database, a runtime error is thrown when growing to full core. It appears that with the latter method, the global assembly number is set incorrectly.
Works:
Throws
RuntimeError
:The text was updated successfully, but these errors were encountered: