mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Respond to @pshriwise comment on #2074
This commit is contained in:
parent
cc338c98d5
commit
88eb736884
1 changed files with 3 additions and 2 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue