diff --git a/openmc/universe.py b/openmc/universe.py index db0d55f21d..bdd6e6ec98 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -469,7 +469,7 @@ class Universe(UniverseBase): """ nuclides = OrderedDict() - if len(self._atoms) > 0: + if self._atoms: volume = self.volume for name, atoms in self._atoms.items(): nuclide = openmc.Nuclide(name) diff --git a/tests/unit_tests/test_universe.py b/tests/unit_tests/test_universe.py index 6f4177f54c..33c86b1506 100644 --- a/tests/unit_tests/test_universe.py +++ b/tests/unit_tests/test_universe.py @@ -139,7 +139,7 @@ def test_get_nuclide_densities(): material = openmc.Material() material.add_elements_from_formula("H2O") material.set_density("g/cm3", 1) - cell = openmc.Cell(region=-surf,fill=material) + cell = openmc.Cell(region=-surf, fill=material) universe = openmc.Universe(cells=[cell]) with pytest.raises(RuntimeError): universe.get_nuclide_densities()