-
Notifications
You must be signed in to change notification settings - Fork 89
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
Move number of assemblies out of global space #617
Comments
Okay, I found what I think is the only reason that we have a armi/armi/reactor/assemblies.py Lines 99 to 100 in 907f2b4
When we create a new |
Perhaps we could just give each assembly that needs a unique ID one from the linux timestamp: from time import time
assemNum = int(time() * 1e8) Then each assembly should have a unique number. And when we need create a reactor, we can go through each assembly and re-number them quickly, starting with zero (and preserving the order). |
Also, I feel like the biggest troubles come from giving assemblies number when building a It seems like, in that scenario, we can just provide sequential assembly numbers while reading through the CS file. |
This was closed with: #1383 |
There have been several bugs recently due to strange race conditions and edge cases to do with the fact that the total number of assemblies in a reactor is stored in a global variable:
armi/armi/reactor/assemblies.py
Lines 36 to 44 in 907f2b4
It appears all of these bugs have been present in the code for years. And in the past few weeks I have had to work on several of these issues.
Since the rest of the codebase is Object Oriented, I see now reason why this one
Reactor
value shouldn't be part of theReactor
object. And that is my suggestion for fixing it.The text was updated successfully, but these errors were encountered: