You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Over on this PR, I noted a strange point in the ARMI API.
When an Assembly has no children/Blocks, this method returns a "default area" of 1.0. Surely that should be an error? Or it should return None. Or it should return 0.0. Returning a valid numerical value just seems crazy.
This might be one of those "not all things in the composite pattern" should be implemented kind of thing. I'd be careful with areas though. Typically you make a composite and then add things to it. Not sure if it should be None either. Can you point to the code here?
This might be one of those "not all things in the composite pattern" should be implemented kind of thing. I'd be careful with areas though. Typically you make a composite and then add things to it. Not sure if it should be None either. Can you point to the code here?
"{} has no blocks and therefore no area. Assuming 1.0".format(self)
)
return1.0
I'd say None with a runLog.warning would be appropriate. Or you could raise an error. That'd work too. If someone is creating an Assembly and then querying its area without a Block I think it would be a mistake and getting 1.0 would be unexpected. But maybe there's an application I'm not aware of where an Assembly can do "stuff" without a Block?
Over on this PR, I noted a strange point in the ARMI API.
When an
Assembly
has no children/Blocks
, this method returns a "default area" of1.0
. Surely that should be an error? Or it should returnNone
. Or it should return0.0
. Returning a valid numerical value just seems crazy.armi/armi/reactor/assemblies.py
Lines 274 to 278 in f5fd79b
The text was updated successfully, but these errors were encountered: