From 3271c08d22d60b21546bbb948cd967a46b2023cd Mon Sep 17 00:00:00 2001 From: Ethan Peterson Date: Mon, 8 Aug 2022 11:34:10 -0400 Subject: [PATCH] Apply suggestions from @paulromano code review Co-authored-by: Paul Romano --- openmc/material.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index 724b88ab4..c89109bfa 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -917,7 +917,6 @@ class Material(IDManagerMixin): Returns ------- - Union[dict, float] If by_nuclide is True then a dictionary whose keys are nuclide names and values are activity is returned. Otherwise the activity @@ -939,10 +938,7 @@ class Material(IDManagerMixin): inv_seconds = openmc.data.decay_constant(nuclide) activity[nuclide] = inv_seconds * 1e24 * atoms_per_bcm * multiplier - if by_nuclide: - return activity - else: - return sum(activity.values()) + return activity if by_nuclide else sum(activity.values()) def get_nuclide_atoms(self): """Return number of atoms of each nuclide in the material