-
Notifications
You must be signed in to change notification settings - Fork 87
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
Cleaning out the overly-specific methods in ArmiObject #1667
Conversation
…yLine to Assembly
Bump |
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.
Hmmmm.
Moving ArmiObject.getBoronMassEnrich() to Block
Moving ArmiObject.getPuMoles() to Block
Moving ArmiObject.getUraniumMassEnrich() to Block
I could see utility in having this at the composite level. I don't think it's unreasonable to have the ability to query these things at the Assembly, Core, or Component level (specifically on the Component as well, for flexibility with future applications)
If it helps, I tested this PR downstream in all repos, including benchmark repos, it passes. So that is firm confirmation that these methods are NOT used at the Cards on the table... None of these methods should have been added to the API in the first place. That was the cause of Jake/Mark's complaint. They are fair too specific. An entire method for just one nuclide? If we have one for "boron mass' why not "boron moles" and "uranium mass" and "uranium moles" and OMG that paradigm leads us to hundreds and hundreds of nearly identical stupid methods. Jake and Mark make a compelling argument: (1) remove any of these too-specific methods we can, and (2) reduce the surface area of the ones we can't remove. Moving these methods from |
Oh yeah, totally agree here. I wonder if they could be generalized? Hmmm, likely not in a useful/elegant way. The underlying functionality of these is retained, so any downstream user could recreate them as needed. Ok, I will retract. Remove! |
Yeah, I was thinking something like: # class ArmiObject
def getNuclide(self, nuclide, units="mass"):
"""Note: units needs to be in ("mass", "frac", "moles")""" Or, you know, something like that. Some sort of more general method that replaces all this stuff. Also, I note that we already have #just-thinking-aloud |
You could always do a poll in the discussion on what would be useful! |
Co-authored-by: Tony Alberti <aalberti@terrapower.com>
What is the change?
Removing extraneous
ArmiOjbect
methods:ArmiObject.getBoronMassEnrich()
toBlock
ArmiObject.getPuMoles()
toBlock
ArmiObject.getUraniumMassEnrich()
toBlock
ArmiObject.getMaxUraniumMassEnrich.()
ArmiObject.getMaxVolume()
&Block.getMaxVolume()
ArmiObject.getPuFrac()
ArmiObject.getPuMass()
ArmiObject.getPuN()
ArmiObject.getZrFrac()
ArmiObject.printDensities()
Composite.isOnWhichSymmetryLine()
toAssembly
Block.isOnWhichSymmetryLine()
Why is the change being made?
There are several methods in
ArmiObject
(andComposite
) that seem a little too specific to be included everywhere in the ARMI object tree. And after doing some research, some of them are entirely unused anyway.Close #1375
Checklist
doc
folder.pyproject.toml
.