Skip to content

Commit b7e4c6c

Browse files
pshriwiseclaude
andcommitted
Add type check for universe argument in DAGMCCell.from_xml_element
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5e0a047 commit b7e4c6c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

openmc/dagmc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,11 @@ def from_xml_element(cls, elem, mats, universe):
654654
DAGMCCell
655655
DAGMCCell instance
656656
"""
657+
if not isinstance(universe, DAGMCUniverse):
658+
raise TypeError(
659+
f"universe must be a DAGMCUniverse instance, "
660+
f"got {type(universe).__name__}.")
661+
657662
cell_id = int(get_text(elem, 'id'))
658663

659664
# Validate attributes that are unsupported for DAGMC cell overrides

0 commit comments

Comments
 (0)