Skip to content

Commit

Permalink
improve robustness of type check
Browse files Browse the repository at this point in the history
  • Loading branch information
albeanth committed Mar 31, 2023
1 parent ee30364 commit 19d0cc6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion armi/reactor/converters/axialExpansionChanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,9 @@ def determineTargetComponent(self, b, flagOfInterest=None):
componentWFlag = [c for c in b.getChildren() if c.hasFlags(flagOfInterest)]
if len(componentWFlag) == 0:
# didn't match flags so check type before failing
componentWFlag = [c for c in b if c.p.type == b.p.type]
componentWFlag = [
c for c in b if (c.p.type in b.p.type or b.p.type in c.p.type)
]
if len(componentWFlag) == 0:
# if only 1 solid, be smart enought to snag it
solidMaterials = list(
Expand Down
5 changes: 4 additions & 1 deletion armi/reactor/converters/tests/test_axialExpansionChanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,10 @@ def test_specifyTargetComponent_viaType(self):
"""
b = HexBlock("detector", height=10.0)
detectorDims = {"Tinput": 25.0, "Thot": 25.0, "widthOuter": 1.1, "mult": 1.0}
detector = Rectangle("detector", "FakeMat", **detectorDims)
ductDims = {"Tinput": 25.0, "Thot": 25.0, "op": 17, "ip": 0.0, "mult": 1.0}
detector = Rectangle("detector neutron", "FakeMat", **detectorDims)
duct = Hexagon("duct", "FakeMat", **ductDims)
b.add(duct)
b.add(detector)
b.add(self.coolant)
b.setType("detector")
Expand Down

0 comments on commit 19d0cc6

Please sign in to comment.