Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion armi/reactor/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2228,7 +2228,7 @@ def hasPinPitch(self):
return (self.getComponent(Flags.CLAD, quiet=True) is not None) and (
self.getComponent(Flags.WIRE, quiet=True) is not None
)
except Exception:
except ValueError:
# not well defined pitch due to multiple pin and/or wire components
return False

Expand Down
15 changes: 14 additions & 1 deletion armi/reactor/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2373,7 +2373,7 @@ def test_negativeVolume(self):
block.getVolumeFractions()


class HexBlock_TestCase(unittest.TestCase):
class TestHexBlock(unittest.TestCase):
def setUp(self):
self.hexBlock = blocks.HexBlock("TestHexBlock")
hexDims = {"Tinput": 273.0, "Thot": 273.0, "op": 70.6, "ip": 70.0, "mult": 1.0}
Expand Down Expand Up @@ -2778,6 +2778,19 @@ def test_pinPitches(self):
self.assertAlmostEqual(self.hexBlock.getPinPitch(cold=True), 0.11)
self.assertAlmostEqual(self.hexBlock.getPinPitch(cold=False), 0.11)

def test_hasPinPitch(self):
# A HexBlock with no components inside should return False
b = blocks.HexBlock("EmptyHexBlock")
self.assertFalse(b.hasPinPitch())

# A HexBlock with only a clad or a wire component, but not both, should return False
b.add(components.Circle("clad", "HT9", Tinput=273.0, Thot=273.0, od=0.1, mult=169.0))
self.assertFalse(b.hasPinPitch())

# A HexBlock with a clad and a wire component should return True
b.add(components.Circle("wire", "HT9", Tinput=273.0, Thot=273.0, od=0.01, mult=169.0))
self.assertTrue(b.hasPinPitch())

def test_getBlocks(self):
self.assertEqual(len(self.hexBlock.getBlocks()), 1)

Expand Down
Loading