From 606457a1f0ed306fe6a90e1c1474e792b820df5c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 13 Jan 2023 13:36:51 +0700 Subject: [PATCH] A few style fixes in material.py --- openmc/material.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index 7844ec131c..29c01d1463 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -416,10 +416,10 @@ class Material(IDManagerMixin): self._atoms = volume_calc.atoms[self.id] else: raise ValueError('No volume information found for material ID={}.' - .format(self.id)) + .format(self.id)) else: raise ValueError('No volume information found for material ID={}.' - .format(self.id)) + .format(self.id)) def set_density(self, units: str, density: Optional[float] = None): """Set the density of the material @@ -531,11 +531,10 @@ class Material(IDManagerMixin): params['percent_type'] = percent_type - ## check if nuclide + # check if nuclide if not component.isalpha(): self.add_nuclide(component, **params) - else: # is element - kwargs = params + else: self.add_element(component, **params) def remove_nuclide(self, nuclide: str): @@ -1583,7 +1582,6 @@ class Materials(cv.CheckedList): if trailing_indent: file.write(indentation) - def export_to_xml(self, path: PathLike = 'materials.xml'): """Export material collection to an XML file.