From 88eb73688486c03c5960369bac2c911e543f581a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 27 May 2022 06:55:55 -0500 Subject: [PATCH] Respond to @pshriwise comment on #2074 --- openmc/plots.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openmc/plots.py b/openmc/plots.py index a1933cb5c9..b22ee91254 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -637,9 +637,10 @@ class Plot(IDManagerMixin): color = _SVG_COLORS[color.lower()] subelement.text = ' '.join(str(x) for x in color) - # Helper function to handle either int or Cell/Material + # Helper function that returns the domain ID given either a + # Cell/Material object or the domain ID itself def get_id(domain): - return getattr(domain, 'id', domain) + return domain if isinstance(domain, Integral) else domain.id if self._colors: for domain, color in sorted(self._colors.items(),